⚙️ Config¶
The OpenHAIV framework uses a flexible YAML-based configuration system that allows users to easily define and modify various experimental parameters without changing the code. This document provides detailed information about the structure, usage, and major components of the configuration files.
Configuration File Structure¶
OpenHAIV configuration files follow a hierarchical structure, mainly divided into the following sections:
- Base Configuration: Defines basic parameters for experiments, such as random seed, device, output directory, etc.
- Trainer Configuration: Defines parameters for the training process
- Model Configuration: Defines model architecture and related parameters
- Algorithm Configuration: Defines specific algorithms and methods
- Data Loader Configuration: Defines datasets and data loading parameters
- Optimizer Configuration: Defines optimization algorithms and related parameters
- Scheduler Configuration: Defines learning rate scheduling strategies
Configuration files can inherit from other configuration files through the _base_
field, enabling modular and reusable configurations.
Configuration Modules in Detail¶
config.algorithms¶
Algorithm configurations define the specific algorithms and methods used in experiments, including:
Supervised Learning Algorithms¶
Class-incremental Learning Algorithms¶
YAML | |
---|---|
Other supported class-incremental learning algorithms include: Finetune
, Joint
, iCaRL
, EWC
, BiC
, WA
, DER
, Coil
, FOSTER
, SSRE
, FeTrIL
, MEMO
, etc.
Few-shot Class-incremental Learning Algorithms¶
YAML | |
---|---|
Out-of-Distribution Detection Algorithms¶
YAML | |
---|---|
Other supported out-of-distribution detection algorithms include: ODIN
, VIM
, MDS
, DML
, FDBD
, GODIN
, MCM
, GL-MCM
, etc.
config.dataloader¶
Data loader configurations define the datasets and data loading parameters used in experiments:
Supported datasets include: OES
, CIFAR10
, CIFAR100
, ImageNet
, ImageNetR
, CUB200
, Remote
, Food101
, Caltech101
, etc.
config.model¶
Model configurations define the model architecture and related parameters used in experiments:
YAML | |
---|---|
Supported models include:
- Standard CNN models:
ResNet18
,ResNet34
,ResNet50
,ResNet101
- Vision-language models:
CLIP-B/16
,CLIP-B/32
,RSCLIP-B/16
,RSCLIP-B/32
- Algorithm-specific models:
AliceNET
,CoOp
,LoCoOp
,SCT
,DPM
config.pipeline¶
Pipeline configuration files integrate all of the above components into a complete experiment configuration, for example, a supervised learning pipeline configuration:
How to Use Configurations¶
Configuration files can be passed to the training script via command line:
Bash | |
---|---|
The --opts
parameter allows overriding any parameter in the configuration file.
Configuration Inheritance Mechanism¶
OpenHAIV's configuration system supports composition based on inheritance, making configurations more modular and reusable:
Through the inheritance mechanism, repetitive configurations can be avoided, improving the maintainability of configuration files.
Configuration Best Practices¶
Note
Please follow these best practices when using configuration files in OpenHAIV:
- Modular Configuration: Extract common configurations as base configuration files, and combine them through inheritance
- Use Relative Paths: Paths in configuration files should use paths relative to the project root directory when possible
- Comment Key Parameters: Add comments to important parameters to improve readability
- Parameter Tuning: For new tasks, start with existing configurations and gradually adjust parameters
- Version Control: Configuration files for important experiments should be version controlled to reproduce results