3.5. How to Create a ModelZoo Config YAML
Every example under examples/ is driven by a single YAML file.
This guide explains the structure of that file and how to adapt an existing
example to your own dataset and target device.
3.5.1. 1. Config Skeleton and 4-Step Recipe
Almost every config follows the same 6-section skeleton
(based on generic_timeseries_classification/config.yaml):
common: # WHAT task, WHICH device
task_type: generic_timeseries_classification
target_device: F28P55 # F28P55, MSPM0G5187, F29H85, CC2755, AM263 ...
dataset: # WHERE the data is
dataset_name: my_dataset
input_data_path: <URL | .zip | local folder>
data_processing_feature_extraction: # HOW raw signal becomes model input
feature_extraction_name: Generic_1024Input_FFTBIN_64Feature_8Frame # preset
variables: 1 # no. of input channels
training: # WHICH model, HOW to train
model_name: CLS_1k_NPU # from ModelZoo
batch_size: 256
training_epochs: 20
quantization: 2 # 0 = float, 1 = generic INT, 2 = TI-NPU INT
testing: {} # {} = use defaults
compilation: {} # {} = default_preset
Section |
Purpose |
|---|---|
|
Task type, target device, (optionally) output location and run name |
|
Dataset name and where to load it from |
|
Windowing, transforms and feature extraction applied to raw data |
|
Model architecture, training hyperparameters and quantization |
|
Evaluation of the trained model |
|
Compilation into device-ready code with TI’s Neural Network Compiler |
3.5.1.1. 4-Step Recipe
Copy the closest example. Use the use-case folder if one matches your problem (e.g.
motor_bearing_fault). If none does, use the generic example for your task:generic_timeseries_classification,generic_timeseries_regression,generic_timeseries_forecastingorgeneric_timeseries_anomalydetection.Set
common. Picktask_typeandtarget_device. Many examples already ship device-specific variants such asconfig_MSPM0.yaml,config_CC2755.yamlorconfig_CC1352.yaml. Start from those when available.Point
datasetat your data. Setinput_data_path(URL,.zipor local folder) and setvariablesto match the number of input channels in your data.Pick feature extraction and a model, then run:
./run_tinyml_modelzoo.sh examples/<name>/config.yaml # Linux run_tinyml_modelzoo.bat examples\<name>\config.yaml # Windows
Tip: Any key you leave out uses its default value, so
testing: {}andcompilation: {}are valid as written.
3.5.2. 2. Feature Extraction: Preset vs. Custom
Approach |
When |
Example |
|---|---|---|
Preset |
Classification, audio, image |
|
Custom transforms |
Fine-tuning a preset |
|
Windowing only |
Regression, forecasting, anomaly detection |
|
3.5.2.1. Preset example (classification)
data_processing_feature_extraction:
feature_extraction_name: Generic_1024Input_FFTBIN_64Feature_8Frame
variables: 1
Other generic presets available for timeseries classification:
Preset |
Transform |
|---|---|
|
FFT, binned, 8 frames concatenated |
|
FFT, binned, 8 frames concatenated |
|
FFT, binned, 8 frames concatenated |
|
FFT, single frame |
|
FFT, single frame |
|
FFT, single frame |
|
Raw samples, no transform |
|
Raw samples, no transform |
|
Raw samples, no transform |
3.5.2.2. Custom transforms example
data_processing_feature_extraction:
frame_size: 1024
feature_size_per_frame: 64
num_frame_concat: 4
feat_ext_transform: [ 'FFT_FE', 'FFT_POS_HALF', 'DC_REMOVE', 'ABS', 'BINNING', 'LOG_DB', 'CONCAT' ]
variables: 1
3.5.2.3. Windowing-only example (anomaly detection)
data_processing_feature_extraction:
data_proc_transforms:
- SimpleWindow
- Downsample
frame_size: 128
sampling_rate: 100
new_sr: 10
variables: 1
3.5.2.4. How the task type changes the config
Task |
What is different |
|---|---|
Forecasting |
|
Anomaly detection |
Uses |
Regression |
Usually windowing only ( |
Image |
Set |
3.5.2.5. Selecting input channels with variables
variables supports three formats (column indices are 0-indexed, counted after
time columns are removed):
variables: 3 # first N columns
variables: [0, 2, 4] # specific column indices
variables: ['accel_x', 'accel_y'] # column names (requires CSV header)
3.5.3. 3. Useful Knobs
3.5.3.1. Training
Key |
Description |
|---|---|
|
Stop training when validation stops improving |
|
e.g. |
|
e.g. |
|
Initial learning rate |
|
|
3.5.3.2. Quantization
Key |
Description |
|---|---|
|
|
|
|
|
|
|
|
|
Automatically select per-layer precision |
3.5.3.3. Compilation
Key |
Description |
|---|---|
|
|
See NPU Configuration Guidelines for designing models that run efficiently on the TI NPU.
3.5.3.4. Output location
Key |
Description |
|---|---|
|
Where artifacts are written. Default: |
|
Run sub-folder name, e.g. |
3.5.4. Common Pitfalls
Be consistent with indentation. The examples use either 2-space indents with bare values or 4-space indents with quoted values. Both are valid YAML, but every key within one file must use the same indentation.
Match
variablesto your data. A mismatch betweenvariablesand the number of channels in your CSV files is a common source of errors.NPU-only compile presets.
compress_npu_layer_dataandforced_soft_npu_presetapply only to devices with the TinyEngine NPU (e.g. F28P55, MSPM0G5187, AM13E2).