#!/bin/bash

# Exit the script immediately if any command fails
set -e

echo "==================================================="
echo "1/3: Starting CMRF training for Target: HUMAN"
echo "==================================================="
python train_HAC_fast_CMRF.py \
  --use_video \
  --use_audio \
  --use_flow \
  -s animal cartoon \
  -t human \
  --lr 1e-4 \
  --bsz 16 \
  --nepochs 15 \
  --datapath ./data/ \
  --SMA \
  --sma_start_step 100 \
  --CM_mixup \
  --mix_alpha 0.1 \
  --contrast \
  --distill \
  --distill_coef 3.0 \
  --mix_coef 2.0

echo "==================================================="
echo "2/3: Starting CMRF training for Target: ANIMAL"
echo "==================================================="
python train_HAC_fast_CMRF.py \
  --use_video \
  --use_audio \
  --use_flow \
  -s human cartoon \
  -t animal \
  --lr 1e-4 \
  --bsz 16 \
  --nepochs 15 \
  --datapath ./data/ \
  --SMA \
  --sma_start_step 100 \
  --CM_mixup \
  --mix_alpha 0.1 \
  --contrast \
  --distill \
  --distill_coef 3.0 \
  --mix_coef 2.0

echo "==================================================="
echo "3/3: Starting CMRF training for Target: CARTOON"
echo "==================================================="
python train_HAC_fast_CMRF.py \
  --use_video \
  --use_audio \
  --use_flow \
  -s human animal \
  -t cartoon \
  --lr 1e-4 \
  --bsz 16 \
  --nepochs 15 \
  --datapath ./data/ \
  --SMA \
  --sma_start_step 100 \
  --CM_mixup \
  --mix_alpha 0.1 \
  --contrast \
  --distill \
  --distill_coef 3.0 \
  --mix_coef 2.0

echo "==================================================="
echo "All 3 target domains have finished training!"
echo "==================================================="