13.1. Configuration Reference
Reference for the YAML configuration options of Tiny ML ModelZoo 1.5.0. For a step-by-step guide on writing or adapting a config, see How to Create a ModelZoo Config YAML.
Note
The defaults below are read from the init_params() functions of ModelMaker (package tinyml_modelmaker,
file tinyml_modelmaker/ai_modules/<module>/params.py). They are the values used when a key is missing from your
YAML. The tables are written for the timeseries module (target_module: timeseries); the audio, radar and
vision modules add or drop a few keys, listed at the end of each section. Keys that are filled in at run time
(paths, model ids) are not meant to be set by the user and are listed as “internal”.
13.1.1. How a YAML is merged
The user YAML is loaded with yaml.safe_load and merged recursively on top of the defaults (ConfigDict in
tinyml_modelmaker/utils/config_dict.py), so you only need to write the keys you want to change. Then, in the
ModelMaker runner:
the
trainingdefaults of the chosen model are taken from its model description (model_namemust be in theenabled_models_listof the model descriptions; see Model Zoo Reference),a
feature_extraction_namepreset, if given, fills thedata_processing_feature_extractionkeys it defines,a compilation preset is chosen from
compile_preset_nameandtarget_device.
If CUDA is available, training.compile_model and training.native_amp are switched on automatically unless
you set them in the YAML or set training.num_gpus: 0 (utils/hardware_defaults.py).
13.1.2. File structure
common:
# General settings
dataset:
# Dataset configuration
data_processing_feature_extraction:
# Feature extraction settings
training:
# Training parameters
testing:
# Testing configuration
compilation:
# Compilation settings
There is also a download key in the defaults (default None). It is not documented in the examples and is not used
in the shipped configs.
13.1.3. Common section
Key |
Default |
Description |
|---|---|---|
|
|
|
|
|
See the task type list below. |
|
|
Filled in from |
|
|
Target MCU, for example |
|
|
Run folder pattern under |
|
|
Where datasets are downloaded. |
|
|
Parent folder of project outputs. |
|
|
Internal, derived from |
|
|
Set from the model description. |
Task types (common.task_type):
Timeseries:
generic_timeseries_classification,generic_timeseries_regression,generic_timeseries_forecasting,generic_timeseries_anomalydetectionTimeseries application aliases mapped to classification:
arc_fault,motor_fault,ecg_classification,blower_imbalance,pir_detectionOther modules:
audio_classification,radar_classification,image_classification
The byom_compilation task type and the BYOM section of the 1.4.0 reference are not present in the 1.5.0 code
(no match in tinyml_modelmaker). To use your own model see Bring Your Own Model (BYOM).
Target devices (tinyml_modelmaker/ai_modules/timeseries/constants.py, TARGET_DEVICES; the exact devices
valid for a task depend on the model, see Model Zoo Reference):
C2000 F28x: F280013, F280015, F28003, F28004, F2837, F28P55, F28P65, F28E12, F2807x, F28002x, F28P551x, F2837xS, F2838x
C2000 F29x: F29H85, F29P58, F29P32
MSPM0 and MSPM33: MSPM0G3507, MSPM0G3519, MSPM0G5187, MSPM33C32
AM13: AM13E2
AM26x: AM263, AM263P, AM261
Connectivity: CC2755, CC2745, CC1352, CC1312, CC1354, CC1314, CC35X1
13.1.4. Dataset section
Key |
Default |
Description |
|---|---|---|
|
|
Enable dataset handling. |
|
|
Name of a built-in dataset, or your own name when |
|
|
Path or URL of the dataset (folder, zip or URL). Used for custom data. |
|
|
Annotation file, if the format needs one. |
|
|
Internal; where the split dataset is created. |
|
|
Train/val/test ratios. |
|
|
Names of the splits. |
|
|
|
|
|
Maximum number of files used. |
|
|
|
|
|
|
|
|
Annotation folder name. |
|
|
Annotation file prefix. |
|
|
Internal. |
13.1.5. Data processing and feature extraction section
The preset in feature_extraction_name (see Feature Extraction) sets most of these keys
for you. Values you write in the YAML override the preset.
Key |
Default |
Description |
|---|---|---|
|
|
Preset name, for example |
|
|
Data processing transforms: |
|
|
Feature extraction chain. Names used by the 1.5.0 presets: |
|
|
Input columns after the time column(s): an int (first n columns), a list of ints, or a list of column names. |
|
|
Forecasting: columns to predict. |
|
|
Original sampling rate. |
|
|
Target sampling rate (used with |
|
|
Resampling factor. |
|
|
Samples per frame. |
|
|
Stride between frames as a fraction of |
|
|
Forecasting: number of future time steps to predict. |
|
|
Output features per frame. |
|
|
Frames concatenated into one input. |
|
|
Frames skipped between selected frames. |
|
|
First FFT bin kept. |
|
|
Bandwidth factor for binning. |
|
|
Bin normalization. |
|
|
Remove the DC component. |
|
|
Q15 scaling for the fixed-point chain. |
|
|
Parameters of |
|
|
Feature stacking mode ( |
|
|
Offset and scale applied to the input. |
|
|
Dict of class-to-gain range for augmentation. |
|
|
Used by some presets. |
|
|
Store extracted features to disk. |
|
|
Only run feature extraction. |
|
|
Run feature extraction in the NN (for devices without the FE library). |
|
|
Goodness-of-fit test. |
Audio module (target_module: audio) replaces the timeseries keys with: sampling_rate (16000),
audio_duration_ms (1000), audio_feature ("MFCC"), n_mfcc (10), n_mels (40), frame_length_ms
(30), frame_step_ms (20), nlpc (70), lpc_order (10), the learned filterbank keys fb_conv_kernel (64),
fb_output_channel (64), fb_bitwidth (8), fb_conv_stride (4), fb_context_ms (20), input_bit_depth
(16), frame_size (512), normalize_audio (True), mono (True) and augmentation_transform
([]). The allowed values of audio_feature were not listed here; see ai_modules/audio/constants.py.
Radar module (target_module: radar) has the timeseries keys sampling_rate (1), frame_size (8),
variables (1), feat_ext_transform and data_proc_transforms, and no feature extraction presets.
Vision module (target_module: image): image_height (28), image_width (28), image_num_channel (1),
image_mean (0.1307), image_scale (0.3081), feat_ext_transform, data_proc_transforms,
augmentation_transform and the transform parameters pad_value (0), binary_threshold (128),
clahe_clip_limit (2.0), clahe_tile_grid_size ((8, 8)), sobel_mode ("magnitude"), sobel_ksize (3),
laplacian_ksize (3), horizontal_flip_prob (0.5), vertical_flip_prob (0.5), random_rotation_deg (15) and
color_jitter_brightness (0.10), _contrast (0.10), _saturation (0.05), _hue (0.01).
13.1.6. Training section
Training defaults are overridden per model by the model description (for example learning_rate and
batch_size), then by your YAML.
Key |
Default |
Description |
|---|---|---|
|
|
Run the training stage. |
|
|
Must be listed in the |
|
|
Model specification or config (for spec-based models). |
|
|
|
|
|
Augmentation config. Usage not verified in this reference. |
|
|
Start from this checkpoint. |
|
|
Load a saved model. Usage not verified in this reference. |
|
|
Number of epochs. |
|
|
Batch size (model description default overrides). |
|
|
Learning rate. |
|
|
|
|
|
Weight decay. |
|
|
|
|
|
Regularization weight. |
|
|
New in 1.5.0. Stop when the validation metric stops improving. |
|
|
New in 1.5.0. Epochs without improvement before stopping. |
|
|
New in 1.5.0. Minimum change that counts as improvement. |
|
|
|
|
|
|
|
|
Use distributed training when launched for it. |
|
|
|
|
|
PyTorch native AMP. Turned on automatically when CUDA is available and the key is not set. |
|
|
|
|
|
|
|
|
Choices in the training script: 16, 8, 4, 2. |
|
|
Activation bitwidth. |
|
|
New in 1.5.0. Automatic bitwidth selection (binary search, Hessian-based mixed precision). Set |
|
|
Tolerated accuracy drop (fraction) versus the float model. |
|
|
Tolerated R2 drop (fraction). |
|
|
Tolerated SMAPE increase: float SMAPE x (1 + 2.0). |
|
|
Tolerated MSE increase: float MSE x (1 + 2.0). |
|
|
|
|
|
Passed to the radar training script as |
|
|
Run only the quantization training step. |
|
|
Mark the model as trainable on device. See On-Device Training Documentation. |
|
|
Number of trainable layers from the end for on-device training. |
|
|
Flash size of the target in KB. |
|
|
Samples exported per class for (train, val, test), used for the golden vectors. |
|
|
Neural architecture search. |
|
|
|
|
|
Search epochs. |
|
|
Preset mode: |
|
|
Customization mode. |
|
various |
Filled from the model description (internal / GUI metadata). |
|
|
Internal. |
The radar module also has momentum (default 0).
Memory estimation (pre-flight) is not a YAML key. The training script has a --skip_memory_preflight flag, and the
standalone estimate_memory command takes a config file; see Memory Estimation.
13.1.7. Testing section
Key |
Default |
Description |
|---|---|---|
|
|
Run the test stage. |
|
|
Skip training and test an existing model (set |
|
|
Model to test when training is skipped. |
|
|
Test data location. |
|
|
Run inference on the device. Usage not verified in this reference. |
13.1.8. Compilation section
Key |
Default |
Description |
|---|---|---|
|
|
Run the compilation stage (needs the compiler tools, see Common Errors). |
|
|
|
|
|
Keep intermediate library files. |
|
|
Model to compile (normally set by the pipeline). |
|
|
Internal. |
See Supported Devices and NPU Configuration Guidelines for TI Neural Network Compiler for which preset suits which device.
13.1.9. Example
This is examples/dc_arc_fault/config_dsk.yaml without comments:
common:
task_type: arc_fault
target_device: F28P55
dataset:
dataset_name: dc_arc_fault_example_dsk
data_processing_feature_extraction:
feature_extraction_name: FFT1024Input_256Feature_1Frame_Full_Bandwidth
variables: 1
training:
model_name: CLS_1k_NPU
model_config: ''
batch_size: 32
training_epochs: 10
num_gpus: 0
early_stopping: true
early_stopping_patience: 5
testing: {}
compilation: {}