#!/bin/bash

# --------------------------------------
# Metalauncher: RMSE-opt Configs + Batch Size Sweep
# All models use attention = True
# --------------------------------------

REGION="W011"
PATIENCE="10"
LOG_SCALE="False"
ATTENTION="True"
CSV_LOG="True"
CSV_FILE="batch_size.csv"
BATCH_SIZES=("1024" "2048" "4096" "8192" "16384")

# ------------------------
# Vanilla RNN (RMSE-opt)
# ------------------------
CELL_TYPE="rnn"
DROPOUT="0.5"
WD="1e-5"
HS="64"
TF="0.0"

for BS in "${BATCH_SIZES[@]}"; do
  echo "Submitting RNN RMSE-opt | batch=$BS"
  sbatch -A bsc32 -q acc_bsces launch_training_rnn_multiconfig.sh \
    $CELL_TYPE $ATTENTION $DROPOUT $HS $PATIENCE $REGION $TF $LOG_SCALE $WD $BS $CSV_LOG $CSV_FILE
  sleep 1
done

# ------------------------
# LSTM (RMSE-opt)
# ------------------------
CELL_TYPE="lstm"
DROPOUT="0.25"
WD="0.0"
HS="32"
TF="0.0"

for BS in "${BATCH_SIZES[@]}"; do
  echo "Submitting LSTM RMSE-opt | batch=$BS"
  sbatch -A bsc32 -q acc_bsces launch_training_rnn_multiconfig.sh \
    $CELL_TYPE $ATTENTION $DROPOUT $HS $PATIENCE $REGION $TF $LOG_SCALE $WD $BS $CSV_LOG $CSV_FILE
  sleep 1
done

# ------------------------
# GRU (RMSE-opt)
# ------------------------
CELL_TYPE="gru"
DROPOUT="0.5"
WD="1e-5"
HS="64"
TF="0.0"

for BS in "${BATCH_SIZES[@]}"; do
  echo "Submitting GRU RMSE-opt | batch=$BS"
  sbatch -A bsc32 -q acc_bsces launch_training_rnn_multiconfig.sh \
    $CELL_TYPE $ATTENTION $DROPOUT $HS $PATIENCE $REGION $TF $LOG_SCALE $WD $BS $CSV_LOG $CSV_FILE
  sleep 1
done
