#!/bin/bash

# --------------------------------------
# Metalauncher: Region 25 | Log+Scale | Patience Sweep (5, 10)
# One fixed config per architecture
# --------------------------------------

REGION="W025"
LOG_SCALE="True"
ATTENTION="True"
BATCH_SIZE="16384"
CSV_LOG="True"
TEACHER_FORCING="0.0"
CSV_FILE="evaluation_${REGION}_logscale.csv"

PATIENCE_VALUES=(5 10)

# Fixed training and testing years
TRAINING_YEARS="2010 2011 2012 2013 2014"
TESTING_YEARS="2008"

# ------------------
# RNN Configuration
# ------------------
CELL_TYPE="rnn"
DROPOUT="0.5"
WD="1e-5"
HS="64"

for PATIENCE in "${PATIENCE_VALUES[@]}"; do
  echo "Submitting RNN | patience=$PATIENCE | hidden=$HS | dropout=$DROPOUT | wd=$WD"
  sbatch -A bsc32 -q acc_bsces launch_training_rnn_multiconfig.sh \
    $CELL_TYPE $ATTENTION $DROPOUT $HS $PATIENCE $REGION \
    $TEACHER_FORCING $LOG_SCALE $WD $BATCH_SIZE $CSV_LOG $CSV_FILE
  sleep 1
done

# ------------------
# LSTM Configuration
# ------------------
CELL_TYPE="lstm"
DROPOUT="0.25"
WD="0"
HS="32"

for PATIENCE in "${PATIENCE_VALUES[@]}"; do
  echo "Submitting LSTM | patience=$PATIENCE | hidden=$HS | dropout=$DROPOUT | wd=$WD"
  sbatch -A bsc32 -q acc_bsces launch_training_rnn_multiconfig.sh \
    $CELL_TYPE $ATTENTION $DROPOUT $HS $PATIENCE $REGION \
    $TEACHER_FORCING $LOG_SCALE $WD $BATCH_SIZE $CSV_LOG $CSV_FILE
  sleep 1
done

# ------------------
# GRU Configuration
# ------------------
CELL_TYPE="gru"
DROPOUT="0.5"
WD="1e-5"
HS="64"

for PATIENCE in "${PATIENCE_VALUES[@]}"; do
  echo "Submitting GRU | patience=$PATIENCE | hidden=$HS | dropout=$DROPOUT | wd=$WD"
  sbatch -A bsc32 -q acc_bsces launch_training_rnn_multiconfig.sh \
    $CELL_TYPE $ATTENTION $DROPOUT $HS $PATIENCE $REGION \
    $TEACHER_FORCING $LOG_SCALE $WD $BATCH_SIZE $CSV_LOG $CSV_FILE
  sleep 1
done
