#!/bin/bash

#SBATCH --job-name=CTF_Hyundai_practical
#SBATCH --nodes=1
#SBATCH --gres=gpu:1
#SBATCH --time=0-12:00:00
#SBATCH --mem=10G
#SBATCH --cpus-per-task=4 
#SBATCH --partition=P2
#SBATCH --output=/home/s2/hyungjinpark/Practical_baseline/log/CTF/S-%x.%j.out

eval "$(conda shell.bash hook)"

export CUDA_VISIBLE_DEVICES=0

model_name=ChannelTokenFormer
des='ChannelTokenFormer-M'
dataset='Hyundai_forward_fill'
sampling_rates=$(for ((i=0; i<6; i++)); do printf "60 "; done; \
                 for ((i=0; i<1; i++)); do printf "10 "; done; \
                 for ((i=0; i<3; i++)); do printf "1 "; done)

patch_lens=$(for ((i=0; i<6; i++)); do printf "2 "; done; \
             for ((i=0; i<1; i++)); do printf "12 "; done; \
             for ((i=0; i<3; i++)); do printf "60 "; done)


batch_size=(32)
pred_len=(120 240 480 840)
seq_len=(120)
num_heads=(8)
learning_rate=(0.001)
d_model=(128)
d_ff_ratio=(1)
e_layers=(2)
seed=(2021 2022 2023 2024 2025)

for rs in "${seed[@]}"; do
    for bs in "${batch_size[@]}"; do
        for pl in "${pred_len[@]}"; do
            for sl in "${seq_len[@]}"; do
                for nh in "${num_heads[@]}"; do 
                    for lr in "${learning_rate[@]}"; do
                        for dm in "${d_model[@]}"; do
                            for dfr in "${d_ff_ratio[@]}"; do
                                for el in "${e_layers[@]}"; do

                                    echo "================================================"
                                    echo "batch_size: $bs"
                                    echo "d_model: $dm"
                                    echo "d_ff: $(($dm * $dfr))"
                                    echo "num_heads: $nh"
                                    echo "seq_len: $sl"
                                    echo "pred_len: $pl"
                                    echo "learning_rate: $lr"
                                    echo "model_name: $model_name"
                                    echo "seed: $rs"
                                    echo "================================================"

                                    python -u /home/s2/hyungjinpark/Practical_baseline/run.py \
                                    --task_name long_term_forecast \
                                    --is_training 1 \
                                    --root_path /shared/s2/lab01/timeSeries/forecasting/CHS/ \
                                    --data_path $dataset.csv \
                                    --model_id $dataset'_'$sl'_'$pl \
                                    --model $model_name \
                                    --data $dataset \
                                    --features M \
                                    --seq_len $sl \
                                    --label_len 48 \
                                    --pred_len $pl \
                                    --e_layers $el \
                                    --d_layers 1 \
                                    --factor 3 \
                                    --enc_in 10 \
                                    --dec_in 10 \
                                    --c_out 10 \
                                    --des $des \
                                    --d_model $dm \
                                    --d_ff $(($dm * $dfr)) \
                                    --n_heads $nh \
                                    --learning_rate $lr \
                                    --attention_map 0 \
                                    --batch_size $bs \
                                    --patch_lens $patch_lens \
                                    --sampling_rates $sampling_rates \
                                    --num_global_tokens 1 \
                                    --ind_glb 1 \
                                    --self_temp 1 \
                                    --use_norm 1 \
                                    --keep_prob 1 \
                                    --fix_seed $rs \
                                    --itr 1
                                done
                            done
                        done
                    done
                done
            done
        done
    done
done