#!/bin/bash
#SBATCH --job-name=classic_mnist_individual_explanations
#SBATCH --output=logs/classic_mnist_individual_explanations_%A_%a.out
#SBATCH --error=logs/classic_mnist_individual_explanations_%A_%a.err
#SBATCH --array=0-2    # (1 label * 3 samples) - 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"

# Configuration
NUM_LABELS=1
NUM_SAMPLES=3

# Compute indices
LABEL_INDEX=$((TASK_ID / NUM_SAMPLES))
SAMPLE_INDEX=$((TASK_ID % NUM_SAMPLES))

# Compute actual values
LABEL=$((LABEL_INDEX+5))
SAMPLE=$SAMPLE_INDEX

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

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