You can perform data augmentation by passing specific augmentation type labels as command-line arguments to run.py.
To control the frequency of augmentation, use the --augmentation_ratio parameter. This parameter represents how many times the augmentation method is performed. For example:
- Setting
--augmentation_ratio 1 followed by --jitter performs the jitter augmentation once. - Setting
--augmentation_ratio 3 followed by three different augmentation labels will perform those three augmentations three times each (or according to the specific implementation logic of the ratio).
Note: The augmentation code follows the standard Time-Series-Library prototype. All other training parameters (like --batch_size, --learning_rate, etc.) are configurable via run.py.
export CUDA_VISIBLE_DEVICES=0
model_name=PatchTST
for aug in jitter scaling permutation magwarp timewarp windowslice windowwarp rotation spawner dtwwarp shapedtwwarp wdba discdtw discsdtw
do
echo using augmentation: ${aug}
python -u run.py \
--task_name classification \
--is_training 1 \
--root_path ./dataset/EthanolConcentration/ \
--model_id EthanolConcentration \
--model $model_name \
--data UEA \
--e_layers 3 \
--batch_size 16 \
--d_model 128 \
--d_ff 256 \
--top_k 3 \
--des 'Exp' \
--itr 1 \
--learning_rate 0.001 \
--train_epochs 100 \
--patience 10 \
--augmentation_ratio 1 \
--${aug}
done