#!/bin/bash

# Array of corruption types
corruptions=(
        'Gaussian Noise'
        'Shot Noise'
        'Impulse Noise'
        'Defocus Blur'
        'Glass Blur'
        'Motion Blur'
        'Zoom Blur'
        'Snow'
        'Frost'
        'Fog'
        'Brightness'
        'Contrast'
        'Elastic Transform'
        'Pixelate'
        'JPEG Compression'
        # "stl"
        # "None"
)

# Base command parameters
name_base="test_tiny_imagenet_c_cnn_gru_gn"
problem="tiny_imagenet_c"
model="dt_net_2d_custom"
model_name="cnn_gru_gn_tiny_imagenet"
num_class=200
epochs=150
alpha=0.0
beta=0.5
width=128
test_batch_size=128
test_iterations_high=100
# model_path="/home/fis/workspace_AI/AI-RnD/hieutb2/deep-thinking/outputs/cifar_c_cnn_gru_gn_width_128_self_verify/training-2025-04-23 16:03:27.591043"
# model_path="/home/fis/workspace_AI/AI-RnD/hieutb2/deep-thinking/outputs/cifar_c_cnn_gru_gn_width_128_self_verify/training-2025-04-28 08:29:26.958565"
# model_path="/home/fis/workspace_AI/AI-RnD/hieutb2/deep-thinking/outputs/cifar_c_cnn_ligru_width_128/training-2025-04-30 12:52:43.507763"
# model_path="/home/fis/workspace_AI/AI-RnD/hieutb2/deep-thinking/outputs/cifar_c_cnn_gru_gn_width_128/training-2025-04-21 23:50:27.992504"
model_path="/home/fis/workspace_AI/AI-RnD/hieutb2/deep-thinking/outputs/tiny_imagenet_c_cnn_gru_gn_tiny_imagenet_alpha_0.0/training-2025-05-09 18:23:42.473749"
# model_path="/home/fis/workspace_AI/AI-RnD/hieutb2/deep-thinking/outputs/tiny_imagenet_c_resnet_tiny_imagenet/training-2025-05-10 18:28:16.545704"

# 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_high} \
        problem.hyp.test_batch_size=${test_batch_size} \
        problem.hyp.noise_problem="${corruption}" \
        problem.test_data=hard \
        problem.model.width=${width} \
        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'