#!/bin/bash

GPUS=$1
NB_COMMA=`echo ${GPUS} | tr -cd , | wc -c`
NB_GPUS=$((${NB_COMMA} + 1))

NOTE="ait" # Short description of the experiment. (WARNING: logs/results with the same note will be overwritten!)

METHOD="mvp-clip"
VIS_CLASS="all"

# cifar10,cifar100,tinyimagenet,imagenet-r,imagenet
# cub200,stanfordcars,flowers102,oxford_pet,eurosat,caltech101,food101,sun397,aircraft
DATASET="cifar100" 
ZS_DATASET="flowers102,oxford_pet,eurosat,caltech101,food101,imagenet-r,sun397,aircraft,cub200,stanfordcars"


N_TASKS=5

BLURRY=niid
BA=0.3
BS=0.3

BA_SIGMA=0.2
BS_ALPHA=1

RAND_NM="--rnd_NM"
# RAND_NM=""


GPU_TRANSFORM="--gpu_transform"
USE_AMP="--use_amp"

MEM_SIZE=0 ONLINE_ITER=3
MODEL_NAME="ViT-B/16" EVAL_PERIOD=1000
BATCHSIZE=64; LR=5e-3 OPT_NAME="adam" SCHED_NAME="default"


for seed in 2022 2023 2024 2025 2026
do
    INFO="${METHOD}_${NOTE}_SEED${seed}"
    CUDA_VISIBLE_DEVICES=${GPUS} python main.py --method $METHOD \
    --dataset $DATASET --zero_shot_dataset $ZS_DATASET \
    --n_tasks $N_TASKS --m $M --n $N $RAND_NM \
    --rnd_seed $seed  --visible_classes $VIS_CLASS \
    --blurry_mod $BLURRY --blurry_always $BA --blurry_sudden $BS \
    --ba_sigma $BA_SIGMA --bs_alpha $BS_ALPHA \
    --model_name $MODEL_NAME --opt_name $OPT_NAME --sched_name $SCHED_NAME \
    --lr $LR --batchsize $BATCHSIZE --online_iter $ONLINE_ITER \
    --memory_size $MEM_SIZE $GPU_TRANSFORM --data_dir data \
    --note $INFO --eval_period $EVAL_PERIOD --n_worker 4 --num_gpus ${NB_GPUS} --use_mask --use_contrastiv 
done
