#!/bin/bash

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

# Base command parameters
name_base="test_cifar100_c_cnn_gru_gn_width_128_act_0.5"
problem="cifar100_c"
model="dt_net_2d_custom"
model_name="cnn_gru_gn_act"
num_class=100
epochs=150
alpha=0.0
beta=0.5
width=128
test_batch_size=128
test_iterations_hight=100
# model_path="/home/fis/workspace_AI/AI-RnD/hieutb2/deep-thinking/outputs/cifar100_c_cnn_ligru_width_128/training-2025-05-03 09:19:18.223383"
# model_path="/home/fis/workspace_AI/AI-RnD/hieutb2/deep-thinking/outputs/cifar100_c_cnn_gru_gn_width_128/training-2025-05-01 10:19:34.467310"
model_path="/mnt/storage/aird/AI-RnD/hieutb2/deep-thinking/outputs/cifar100_c_cnn_gru_gn_width_128_act_0.5/training-smectic-Sandria"

# 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.model.model_path="${model_path}" \
        problem.model.width=${width} \
        problem.hyp.noise_problem="${corruption}" \
        problem.test_data=hard 
    echo "Completed test for corruption: $corruption"
done



# python test_model.py \
#         name=cifar_c_cnn_gru_gn_act_0.0002 \
#         problem=cifar_c \
#         problem/model=dt_net_2d_custom \
#         problem.model.model=cnn_gru_gn_act \
#         problem.model.num_class=10 \
#         problem.hyp.epochs=150 \
#         problem.hyp.alpha=0.0 \
#         problem.hyp.beta=0.5 \
#         problem.hyp.act=0.0002 \
#         problem.hyp.noise_problem='Total Noise' \
#         problem.model.model_path="/home/tranhieu/workdir/research/deep-thinking/outputs/cifar_c_cnn_gru_gn_act_0.0002/training-2024-12-31 10:59:07.106730"

# python test_model.py \
#         name=cifar_c_cnn_gru_pos_enc_gn_alpha_0.0 \
#         problem=cifar_c \
#         problem/model=dt_net_2d_custom \
#         problem.model.model=cnn_gru_pos_enc_gn \
#         problem.model.num_class=10 \
#         problem.hyp.epochs=150 \
#         problem.hyp.alpha=0.0 \
#         problem.hyp.beta=0.5 \
#         problem.hyp.noise_problem='Total Noise' \
#         problem.model.model_path="/home/tranhieu/workdir/research/deep-thinking/outputs/cifar_c_cnn_gru_pos_enc_gn_alpha_0.0/training-2024-12-26 10:27:14.774989"

# python test_model.py \
#         name=cifar_c_cnn_gru_pos_enc_alpha_0.0 \
#         problem=cifar_c \
#         problem/model=dt_net_2d_custom \
#         problem.model.model=cnn_gru_pos_enc \
#         problem.model.num_class=10 \
#         problem.hyp.epochs=150 \
#         problem.hyp.alpha=0.0 \
#         problem.hyp.beta=0.5 \
#         problem.hyp.noise_problem='Total Noise' \
#         problem.model.model_path="/home/tranhieu/workdir/research/deep-thinking/outputs/cifar_c_cnn_gru_pos_enc_alpha_0.0/training-2024-12-22 15:01:08.205292"

# python test_per_sample.py \
#         name=cifar_c_cnn_gru_gn_alpha_0.0 \
#         problem=cifar_c \
#         problem/model=dt_net_2d_custom \
#         problem.model.model=cnn_gru_gn \
#         problem.model.num_class=10 \
#         problem.hyp.epochs=150 \
#         problem.hyp.alpha=0.0 \
#         problem.hyp.beta=0.5 \
#         problem.hyp.noise_problem='Gaussian Noise' \
#         problem.model.model_path="/home/tranhieu/workdir/research/deep-thinking/outputs/cifar_c_cnn_gru_gn_alpha_0.0/training-2024-12-25 16:04:12.873212"

# python test_model.py \
#         name=cifar_c_cnn_gru_gn_alpha_0.0 \
#         problem=cifar_c \
#         problem/model=dt_net_2d_custom \
#         problem.model.model=cnn_gru_gn \
#         problem.model.num_class=10 \
#         problem.hyp.epochs=150 \
#         problem.hyp.alpha=0.0 \
#         problem.hyp.beta=0.5 \
#         problem.hyp.noise_problem='Pixelate' \
#         problem.model.model_path="/home/tranhieu/workdir/research/deep-thinking/outputs/cifar_c_cnn_gru_gn_alpha_0.0/training-2024-12-25 16:04:12.873212"

# python test_model.py \
#         name=cifar_c_resnet_cifar \
#         problem=cifar_c \
#         problem/model=dt_net_2d_custom \
#         problem.model.model=resnet_cifar \
#         problem.model.num_class=10 \
#         problem.hyp.epochs=150 \
#         problem.hyp.alpha=0.0 \
#         problem.hyp.beta=0.5 \
#         problem.hyp.noise_problem='Pixelate' \
#         problem.model.model_path="/home/tranhieu/workdir/research/deep-thinking/outputs/cifar_c_resnet_cifar/training-2025-01-02 09:06:59.368301"


# 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'