{ "cells": [ { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "# Configuration basics" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "[](https://colab.research.google.com/github/fostiropoulos/ablator/blob/v0.0.1-mp/docs/source/notebooks/Configuration-Basics.ipynb)\n", "\n", "Ablator embraces a versatile configuration system that configures every facet of the training process of machine learning models, covering not only the model architecture but also the training environment.\n", "\n", "Think of this configuration system as a blueprint for crafting experiments. By leveraging this system, Ablator orchestrates the creation and setup of experiments, seamlessly integrating the necessary configurations. Furthermore, Ablator offers the flexibility to dynamically construct a hierarchical configuration through composition.\n", "\n", "You have the choice to override settings either by using Python named arguments, by `yaml` configuration files, or by using dictionaries. In this tutorial, we will explain all configuration-related concepts in Ablator. We will also demonstrate all necessary steps to configure an experiment in Ablator (named arguments method). Delve into [this section](#alternatives-to-constructing-configuration-objects) of this tutorial to gain insights into implementing the latter two approaches." ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "## Configuration categories\n", "\n", "In ablator, configurations are divided into different categories, these include:\n", "\n", "- [Model configuration](#model-configuration) (or model config).\n", "\n", "- [Training configuration](#training-configuration) (or training config/ train config).\n", "\n", "- [Optimizer and Scheduler configuration](#optimizer-and-scheduler-configurations) (or optimizer config and scheduler config).\n", "\n", "- [Running configurations](#running-configurations) (or run configuration/ running config/ run config), either for training a single prototype model or training multiple models in parallel.\n", "\n", "These configuration classes will be used together to configure an experiment." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Model Configuration" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "Model configuration is required when creating the run configuration (`RunConfig.model_config` and `ParallelConfig.model_config`). This configuration class is used to define [hyperparameters](https://en.wikipedia.org/wiki/Hyperparameter_(machine_learning)) specific to the model of interest. By default, it does not have any attribute, instead, we typically inherit from this and add custom attributes for each of the hyperparameters specific to our models. Later, you will use this configuration to construct the model.\n", "\n", "There are 2 steps that are required after defining a model config class for your model:\n", "\n", "- Pass the model config to the main model's constructor so you can construct the model using the attributes that's defined in the config.\n", "\n", "- Create a custom [running configuration class](#running-configurations) and update `model_config` class type to the newly created model config class.\n", "\n", "