#!/bin/bash

REGION="W025"
PATIENCE="10"
HIDDEN_SIZE="32"
LOG_SCALE_OPTIONS=("False")
WEIGHT_DECAY_VALUES=("0" "1e-5" "1e-4" "1e-3" )

# --- RNN ---
CELL_TYPE="rnn"
ATTENTION="True"
DROPOUT="0.0"
TEACHER_FORCING="0.0"
for LOG_SCALE in "${LOG_SCALE_OPTIONS[@]}"; do
  for WEIGHT_DECAY in "${WEIGHT_DECAY_VALUES[@]}"; do
    echo "Submitting RNN | tf=$TEACHER_FORCING | log_scale=$LOG_SCALE | wd=$WEIGHT_DECAY"
    sbatch -A bsc32 -q acc_bsces launch_training_rnn_multiconfig.sh \
      $CELL_TYPE $ATTENTION $DROPOUT $HIDDEN_SIZE $PATIENCE $REGION $TEACHER_FORCING $LOG_SCALE $WEIGHT_DECAY
    sleep 1
  done
done

# --- LSTM (config 1: attn=False, tf=0.75, dropout=0.25) ---
CELL_TYPE="lstm"
ATTENTION="False"
DROPOUT="0.25"
TEACHER_FORCING="0.75"
for LOG_SCALE in "${LOG_SCALE_OPTIONS[@]}"; do
  for WEIGHT_DECAY in "${WEIGHT_DECAY_VALUES[@]}"; do
    echo "Submitting LSTM (no-attn) | tf=$TEACHER_FORCING | log_scale=$LOG_SCALE | wd=$WEIGHT_DECAY"
    sbatch -A bsc32 -q acc_bsces launch_training_rnn_multiconfig.sh \
      $CELL_TYPE $ATTENTION $DROPOUT $HIDDEN_SIZE $PATIENCE $REGION $TEACHER_FORCING $LOG_SCALE $WEIGHT_DECAY
    sleep 1
  done
done

# --- LSTM (config 2: attn=True, tf=0.25, dropout=0.25) ---
ATTENTION="True"
TEACHER_FORCING="0.25"
for LOG_SCALE in "${LOG_SCALE_OPTIONS[@]}"; do
  for WEIGHT_DECAY in "${WEIGHT_DECAY_VALUES[@]}"; do
    echo "Submitting LSTM (attn) | tf=$TEACHER_FORCING | log_scale=$LOG_SCALE | wd=$WEIGHT_DECAY"
    sbatch -A bsc32 -q acc_bsces launch_training_rnn_multiconfig.sh \
      $CELL_TYPE $ATTENTION $DROPOUT $HIDDEN_SIZE $PATIENCE $REGION $TEACHER_FORCING $LOG_SCALE $WEIGHT_DECAY
    sleep 1
  done
done

# --- GRU (config 1: tf=0.5, dropout=0.25) ---
CELL_TYPE="gru"
TEACHER_FORCING="0.5"
DROPOUT="0.25"
ATTENTION="True"
for LOG_SCALE in "${LOG_SCALE_OPTIONS[@]}"; do
  for WEIGHT_DECAY in "${WEIGHT_DECAY_VALUES[@]}"; do
    echo "Submitting GRU | tf=$TEACHER_FORCING | log_scale=$LOG_SCALE | wd=$WEIGHT_DECAY"
    sbatch -A bsc32 -q acc_bsces launch_training_rnn_multiconfig.sh \
      $CELL_TYPE $ATTENTION $DROPOUT $HIDDEN_SIZE $PATIENCE $REGION $TEACHER_FORCING $LOG_SCALE $WEIGHT_DECAY
    sleep 1
  done
done

# --- GRU (config 2: tf=0.0, dropout=0.25) ---
TEACHER_FORCING="0.0"
for LOG_SCALE in "${LOG_SCALE_OPTIONS[@]}"; do
  for WEIGHT_DECAY in "${WEIGHT_DECAY_VALUES[@]}"; do
    echo "Submitting GRU | tf=$TEACHER_FORCING | log_scale=$LOG_SCALE | wd=$WEIGHT_DECAY"
    sbatch -A bsc32 -q acc_bsces launch_training_rnn_multiconfig.sh \
      $CELL_TYPE $ATTENTION $DROPOUT $HIDDEN_SIZE $PATIENCE $REGION $TEACHER_FORCING $LOG_SCALE $WEIGHT_DECAY
    sleep 1
  done
done
