#!/bin/bash
#SBATCH --job-name=classic_mnist_ordering_explanations
#SBATCH --output=logs/classic_mnist_ordering_explanations_%A_%a.out
#SBATCH --error=logs/classic_mnist_ordering_explanations_%A_%a.err
#SBATCH --array=0-3     # 4 orderings - 1
#SBATCH --time=24:00:00
#SBATCH --cpus-per-task=1
#SBATCH --mem=8G
#SBATCH --constraint="hsw"

TASK_ID=$SLURM_ARRAY_TASK_ID
DATASET="mnist"
ORDERINGS=("linear" "random" "verix" "sensitivity")

# Configuration
LABEL=5
SAMPLE=1
ORDERING=${ORDERINGS[$TASK_ID]}

echo "Running task $TASK_ID on dataset $DATASET with LABEL=$LABEL, ORDERING=$ORDERING, and SAMPLE=$SAMPLE"

python -m scripts.tools.generate_explanations \
    --dataset "$DATASET" \
    --explainer individual \
    --label "$LABEL" \
    --sample-index "$SAMPLE" \
    --ordering "$ORDERING" \
    --epsilon 0.05 \
    --num-explanations 1 \
    --num-consumers 1 \
    --output data/logs/cluster/examples/ordering-explanations/"$DATASET"_label_"$LABEL"_sample_"$SAMPLE"_ordering_"$ORDERING".json
