Keywords Introduction
Training a model using the HAT algorithm toolkit is usually done with a single command:
In which, /PATH/TO/CONFIG is the config file for model training, which defines the model structure, dataset loading, and the entire training process.
This section introduces some fixed global keywords in the config file and their configuration descriptions, giving you an overview of the config file.
Global Keywords
The reason why these variables are called global keywords is that they are defined in almost every config file and basically carry the same functions. By reading this document, you can get a general idea of what a config file can do.
Configuration
This section describes the configuration of the global keyword for the data type dict.
Global keywords of the dict type can be further divided into the following two types:
-
Those with
type, such asmodel,data_loader,float_trainer, etc. -
Those without
type, such ascompile_cfg, etc.
The difference is that a global keyword that contains type is essentially a class whose type value can be either a string variable or a specific class, and even if it is a string, it will eventually be built into a corresponding class at runtime. The values of all the keys in the dict except type are used to initialize this class. Similar to global keywords, these keys can be either a numeric value or a dict containing a type variable, such as the dataset property in data_loader, and the transforms property under this dataset.
For a global keyword without a type variable, it is a regular dict variable, and the code will get the corresponding values from its keys during runtime.
All provided configurations are guaranteed to work properly and reproduce the accuracy. If you need to modify the configuration due to the environment or training time, then you may need to change the training strategy as well. Directly modifying individual configurations in the config file sometimes may not lead to desired results.
