#!/bin/bash

# Define best configurations of each cell type and try different teacher forcing ratios

REGION="W025"
PATIENCE="10"
HIDDEN_SIZE="32"
TEACHER_FORCING_RATIOS=(0.0 0.25 0.5 0.75)

# --- RNN ---
CELL_TYPE="rnn"
ATTENTION="True"
DROPOUTS_RNN=("0.0")

for DROPOUT in "${DROPOUTS_RNN[@]}"; do
  for TFR in "${TEACHER_FORCING_RATIOS[@]}"; do
    echo "Submitting RNN | dropout=$DROPOUT | tf_ratio=$TFR"
    sbatch -A bsc32 -q acc_bsces launch_training_rnn_multiconfig.sh \
      $CELL_TYPE $ATTENTION $DROPOUT $HIDDEN_SIZE $PATIENCE $REGION $TFR
    sleep 1
  done
done

# --- GRU ---
CELL_TYPE="gru"
ATTENTION="True"
DROPOUTS_GRU=("0.0" "0.25")

for DROPOUT in "${DROPOUTS_GRU[@]}"; do
  for TFR in "${TEACHER_FORCING_RATIOS[@]}"; do
    echo "Submitting GRU | dropout=$DROPOUT | tf_ratio=$TFR"
    sbatch -A bsc32 -q acc_bsces launch_training_rnn_multiconfig.sh \
      $CELL_TYPE $ATTENTION $DROPOUT $HIDDEN_SIZE $PATIENCE $REGION $TFR
    sleep 1
  done
done

# --- LSTM ---
CELL_TYPE="lstm"
DROPOUTS_LSTM=("0.0" "0.25")
ATTENTIONS_LSTM=("True" "False")

for ATTENTION in "${ATTENTIONS_LSTM[@]}"; do
  for DROPOUT in "${DROPOUTS_LSTM[@]}"; do
    for TFR in "${TEACHER_FORCING_RATIOS[@]}"; do
      echo "Submitting LSTM | attn=$ATTENTION | dropout=$DROPOUT | tf_ratio=$TFR"
      sbatch -A bsc32 -q acc_bsces launch_training_rnn_multiconfig.sh \
        $CELL_TYPE $ATTENTION $DROPOUT $HIDDEN_SIZE $PATIENCE $REGION $TFR
      sleep 1
    done
  done
done
