CLI Wrapper#
aucurriculum provides an aucurriculum.cli
CLI wrapper to programmatically manage the entire curriculum learning-based training process including
configuration management,
data preprocessing,
model training,
inference,
postprocessing,
and curriculum to obtain sample difficulty scores.
Wrapper functions are useful for integrating aucurriculum into custom scripts, jupyter notebooks, google colab notebooks, and other applications.
In addition to the CLI wrapper functions, aucurriculum provides a CLI to manage configurations, data, training, inference, and postprocessing from the command line with the same functionality as the CLI wrapper.
Note
Both the CLI and the Python CLI wrapper serve as a curriculum learning extension to autrainer. For more information on the autrainer CLI wrapper, refer to the autrainer CLI wrapper.
aucurriculum#
usage: aucurriculum [-h] [-v] <command> ...
A Curriculum Learning Toolkit for Deep Learning Tasks built on top of autrainer.
usage: aucurriculum [-h] [-v] <command> ...
Positional Arguments#
- <command>
Possible choices: create, list, show, fetch, preprocess, train, inference, postprocess, rm-failed, rm-states, group, curriculum
Named Arguments#
- -v, --version
show program’s version number and exit
Configuration Management#
To manage configurations, aucurriculum create, aucurriculum list, and aucurriculum show allow for the creation of the project structure and the discovery as well as saving of default configurations provided by aucurriculum and autrainer.
Tip
Default configurations can be discovered both through the CLI, the CLI wrapper, and the respective module documentation.
- aucurriculum.cli.create(directories=None, empty=False, all=False, force=False)[source]#
Create a new curriculum project with default configurations.
- Parameters:
directories (
Optional
[List
[str
]]) – Configuration directories to create. One or more of:CONFIG_DIRS
andCONFIG_DIRS
. Defaults to None.empty (
bool
) – Create an empty project without any configuration directory. Defaults to False.all (
bool
) – Create a project with all configuration directories. Defaults to False.force (
bool
) – Force overwrite if the configuration directory already exists. Defaults to False.
- Return type:
None
- aucurriculum.cli.list(directory, local_only=False, global_only=False, pattern='*')#
List local and global configurations.
- Parameters:
directory (
str
) – The directory to list configurations from. Choose from:CONFIG_DIRS
andCONFIG_DIRS
.local_only (
bool
) – List local configurations only. Defaults to False.global_only (
bool
) – List global configurations only. Defaults to False.pattern (
str
) – Glob pattern to filter configurations. Defaults to “*”.
- Return type:
None
- aucurriculum.cli.show(directory, config, save=False, force=False)[source]#
Show and save a global configuration.
- Parameters:
directory (
str
) – The directory to list configurations from. Choose from:CONFIG_FOLDERS
andCONFIG_FOLDERS
.config (
str
) – The global configuration to show. Configurations can be discovered using the ‘autrainer list’ command.save (
bool
) – Save the global configuration to the local conf directory. Defaults to False.force (
bool
) – Force overwrite local configuration if it exists in combination with save=True. Defaults to False.
- Return type:
None
Preprocessing#
To avoid race conditions when using hydra_launcher_plugins that may run multiple training jobs in parallel, aucurriculum fetch and aucurriculum preprocess allow for downloading and preprocessing of datasets (and pretrained model states) before training.
Both commands are based on the main configuration file (e.g. conf/config.yaml
),
such that the specified models and datasets are fetched and preprocessed accordingly.
If a model or dataset is already fetched or preprocessed, it will be skipped.
For more information on fetching and preprocessing, refer to the autrainer preprocessing CLI wrapper.
Training#
Training is managed by aucurriculum train, which starts the training process
based on the main configuration file (e.g. conf/config.yaml
).
- aucurriculum.cli.train(override_kwargs=None, config_name='config', config_path=None)[source]#
Launch a training configuration.
- Parameters:
override_kwargs (
Optional
[dict
]) – Additional Hydra override arguments to pass to the train script.config_name (
str
) – The name of the config (usually the file name without the .yaml extension). Defaults to “config”.config_path (
Optional
[str
]) – The config path, a directory where Hydra will search for config files. If config_path is None no directory is added to the search path. Defaults to None.
- Return type:
None
Inference#
aucurriculum inference allows for the (sliding window) inference of audio data using a trained model. For more information on the inference process, refer to the autrainer inference CLI wrapper.
Postprocessing#
Postprocessing allows for the summarization, visualization, and aggregation of the training results using aucurriculum postprocess. Several cleanup utilities are provided by aucurriculum rm-failed and aucurriculum rm-states. Manual grouping of the training results can be done using aucurriculum group.
- aucurriculum.cli.postprocess(results_dir, experiment_id, max_runs=None, aggregate=None)[source]#
Postprocess grid search results.
- Parameters:
results_dir (
str
) – Path to grid search results directory.experiment_id (
str
) – ID of experiment to postprocess.max_runs (
Optional
[int
]) – Maximum number of best runs to plot. Defaults to None.aggregate (
Optional
[List
[List
[str
]]]) – Configurations to aggregate. One or more of:VALID_AGGREGATIONS
. Defaults to None.
- Return type:
None
For more information on the cleanup utilities and manual grouping, refer to the autrainer postprocessing CLI wrapper.
Curriculum Scoring
Curriculum scoring is managed by aucurriculum curriculum, which allows for the calculation of sample difficulty scores based on the training results and scoring functions.
- aucurriculum.cli.curriculum(override_kwargs=None, config_name='curriculum', config_path=None)[source]#
Launch a curriculum scoring function configuration.
- Parameters:
override_kwargs (
Optional
[dict
]) – Additional Hydra override arguments to pass to the train script.config_name (
str
) – The name of the config (usually the file name without the .yaml extension). Defaults to “curriculum”.config_path (
Optional
[str
]) – The config path, a directory where Hydra will search for config files. If config_path is None no directory is added to the search path. Defaults to None.
- Return type:
None