#!/bin/bash

# Array of corruption types
corruptions=(
    'shot_noise'
    'impulse_noise'
    'glass_blur'
    'motion_blur'
    'shear'
    'scale'
    'rotate'
    'brightness'
    'translate'
    'stripe'
    'fog'
    'spatter'
    'dotted_line'
    'zigzag'
    'canny_edges'
)

# Base command parameters
name_base="test_mnist_c_cnn_ligru"
problem="mnist_c"
model="dt_net_2d_custom"
model_name="cnn_ligru"
num_class=10
epochs=150
alpha=0.0
beta=0.5
test_batch_size=16
test_iterations_hight=100
model_path="/home/tranhieu/workdir/research/deep-thinking/outputs/mnist_c_cnn_ligru/training-2025-01-21 18:06:30.854313"

# Loop through each corruption and execute the command
for corruption in "${corruptions[@]}"; do
    echo "Running test for corruption: $corruption"
    python test_model.py \
        name=${name_base}_"${corruption}" \
        problem=${problem} \
        problem/model=${model} \
        problem.model.model=${model_name} \
        problem.model.num_class=${num_class} \
        problem.hyp.epochs=${epochs} \
        problem.hyp.alpha=${alpha} \
        problem.hyp.beta=${beta} \
        problem.model.test_iterations.high=${test_iterations_hight} \
        problem.hyp.test_batch_size=${test_batch_size} \
        problem.hyp.noise_problem="${corruption}" \
        problem.model.model_path="${model_path}"
    echo "Completed test for corruption: $corruption"
done

# Augmentation problem hyp
# 'Total Noise'
# 'Gaussian Noise'
# 'Shot Noise'
# 'Impulse Noise'
# 'Defocus Blur'
# 'Glass Blur'
# 'Motion Blur'
# 'Zoom Blur'
# 'Snow'
# 'Frost'
# 'Fog'
# 'Brightness'
# 'Contrast'
# 'Elastic'
# 'Pixelate'
# 'JPEG'
# 'Speckle Noise'
# 'Gaussian Blur'
# 'Spatter'
# 'Saturate'