Single-Task Learning Experiment
Single-task learning experiment is the experiment in CLArena for training and evaluating single-task learning algorithms. This section defines its pipeline and guides you through configuring custom experiments.
Experiment Pipeline
- Training Phase
- The model is trained on the union of training sets
for the specified number of epochs - The single-task learning algorithm’s mechanisms are applied during this phase
- Validation Phase
- At the end of each training epoch, the model is validated on
- Validation results can optionally guide model selection and hyperparameter tuning
- Test Phase
- After completing training and validation, the model is evaluated on the test dataset
- Note: This phase may be skipped based on configuration settings (see
test
in required config fields)
Running
To run a single-task learning experiment, specify the STL_EXPR
indicator in the command:
clarena pipeline=STL_EXPR index=<index-config-name>
Configuration
To run a custom single-task learning experiment, create a YAML file in the index/
folder as index config. Below is an example.
Example
configs/index/example_stl_expr.yaml
# @package _global_
# make sure to include the above commented global setting!
# pipeline info
pipeline: STL_EXPR
expr_name: example_stl_expr
eval: true
global_seed: 1
# components
defaults:
- /stl_dataset: stl_mnist.yaml
- /stl_algorithm: single_learning.yaml
- /backbone: mlp.yaml
- /optimizer: adam.yaml
- /lr_scheduler: reduce_lr_on_plateau.yaml
- /trainer: cpu.yaml
- /metrics: stl_default.yaml
- /lightning_loggers: default.yaml
- /callbacks: stl_default.yaml
- /hydra: default.yaml
- /misc: default.yaml
# outputs
output_dir: outputs/stl_mnist/${misc.timestamp}
Required Config Fields
Field | Description | Allowed Values |
---|---|---|
pipeline |
The default pipeline that clarena use the config to run |
|
expr_name |
The name of the experiment |
|
eval |
Whether to include evaluation phase |
|
global_seed |
The global seed for the entire experiment |
|
/stl_dataset |
The single-task dataset on which the experiment is conducted |
|
/stl_algorithm |
The single-task learning algorithm |
|
/backbone |
The backbone network on which the single-task learning algorithm is based |
|
/optimizer |
The optimizer for learning the single task |
|
/lr_scheduler |
The learning rate scheduler for learning the single task |
|
/trainer |
The PyTorch Lightning Trainer object that contains all configs for training, validation and test process |
|
/metrics |
The metrics to be monitored, logged or visualized |
|
/lightning_loggers |
The Lightning Loggers used to log metrics and results |
|
/callbacks |
The callbacks applied to this experiment (other than metric callbacks). Callbacks are additional actions integrated in different points during the experiment |
|
/hydra |
Configuration for Hydra |
|
/misc |
Miscellaneous configs that are less related to the experiment |
|
output_dir |
The folder storing the experiment results |
|
Note
The single-task learning experiment is managed by a STLExperiment
class. To learn how these fields work, please refer to its source code.