The framework uses [hydra-conf] and leverages its hierarchical configuration feature. This allows configurations to be split up into files and be re-used. The result: a final configuration file made out of different other fragments. More on that in the [composition](composition) section of this page.
# Overview
There exist two configuration locations relative to the root (`/`) of the repository: `/config` and `/edml/config`. They exist for organisational purposes: the former contains the final experiment configuration files and the latter contains partial configurations that can be included into the experiment configuration files. The full configuration file with all available keys and their general purpose looks like this:
```yaml
# Describes which dataset to load.
dataset:
# The name of the dataset to use. This is used as a key inside an if-else branch to determine which method to call.
name:cifar10
# These are custom settings for the above dataset. The keys differ based on the implementation.
average_setting:micro
num_classes:10
# Battery configuration. This field holds the energy consumption of a device based on various metrics.
battery:
# The base consumption per second.
deduction_per_second:0
# The consumption per megaflop of data processed.
deduction_per_mflop:0.001
# The consumption per megabyte of data recieived over the network.
deduction_per_mbyte_received:0.001
# The consumption per megabyte of data sent over the network.
deduction_per_mbyte_sent:0.01
# Points to the loss function to use during backpropagation. This can be a builtin pytorch loss function or a custom one.
loss_fn:
# `_target_` points to the class to instantiate.
_target_:torch.nn.CrossEntropyLoss
# The `experiment` section contains experiment-specific parameters.
experiment:
# The name of the experiment. Used in `wandb` as the project name, too.
# Additionally, the `model_provider.decoder.path` property is taken into account.
-model_provider:[decoder:path]
# `group_name` is a custom resolver for the configuration that takes a value and formats it in a special way for later usage.
# The term `${group_name:${group_by}}` means: use the value `group_by` to setup and configure the grouping. Normally, you'd
# only change the `group_by` configuration value.
group:${group_name:${group_by}}
```
# Composition
What `hydra` allows us to do is to split the various subfields into their own files. For example, we can create a file at `/config/dataset/cifar10.yaml` that contains the following:
```yaml
name:cifar10
average_setting:micro
num_classes:10
```
Inside our configuration yaml file we then write:
```yaml
dataset:cifar10
```
this makes `hydra` look into the `dataset` folder for a file named `cifar10.yaml`. If it is found, its content is added under the `dataset` key. This allows the framework to provide a pre-defined
set of common configurations that one can simply include into their own experiment configuration file, reducing repetition and maintenance.
## Pre-defined configurations
For a set of pre-defined configuration files, please take a look into the `edml/config` folder. We provide configuration files for various datasets, loss functions, models, optimizers and more.