92 lines
3.3 KiB
Bash
Executable File
92 lines
3.3 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Foreground EasyCom F1 plus F5/F6 screening experiments.
|
|
# Usage: bash run_easycom_person_fusion_screening.sh [all|f1|f5-screen|f6-screen] [seed ...]
|
|
set -euo pipefail
|
|
cd "$(dirname "$0")"
|
|
|
|
FEATURE_ROOT=${FEATURE_ROOT:-/data1/yfzx/wangx/Datasets/easycom/omni_features/open_stream_2fps_8s_last4_stack}
|
|
TARGET_ROOT=${TARGET_ROOT:-/data1/yfzx/wangx/Datasets/easycom/easycom_target_frame}
|
|
LOCAL_ROOT=${LOCAL_ROOT:-/data1/yfzx/wangx/Datasets/easycom/omni_features/local_qwen_1s_encoded_tf4576}
|
|
CHECKPOINT_ROOT=${CHECKPOINT_ROOT:-checkpoints/easycom_person_fusion_screening}
|
|
RESULT_ROOT=${RESULT_ROOT:-results/easycom_person_fusion_screening}
|
|
EPOCHS=${EPOCHS:-4}
|
|
WARMUP_EPOCHS=${WARMUP_EPOCHS:-1.6}
|
|
LOCAL_PROJECTION_DIM=${LOCAL_PROJECTION_DIM:-256}
|
|
PERSON_ATTENTION_DIM=${PERSON_ATTENTION_DIM:-256}
|
|
PERSON_ATTENTION_HEADS=${PERSON_ATTENTION_HEADS:-4}
|
|
SUMMARIZE=${SUMMARIZE:-1}
|
|
export OMP_NUM_THREADS=${OMP_NUM_THREADS:-4}
|
|
export MKL_NUM_THREADS=${MKL_NUM_THREADS:-4}
|
|
export OPENBLAS_NUM_THREADS=${OPENBLAS_NUM_THREADS:-4}
|
|
|
|
variant=${1:-all}
|
|
if (( $# )); then shift; fi
|
|
if (( $# )); then seeds=("$@"); else seeds=(0 1 2); fi
|
|
case "$variant" in
|
|
all) variants=(f1 f5-screen f6-screen) ;;
|
|
f1|f5-screen|f6-screen) variants=("$variant") ;;
|
|
*) echo "Expected all, f1, f5-screen, or f6-screen" >&2; exit 2 ;;
|
|
esac
|
|
|
|
mkdir -p "$CHECKPOINT_ROOT" "$RESULT_ROOT"
|
|
|
|
for variant in "${variants[@]}"; do
|
|
case "$variant" in
|
|
f1) fusion=frame-set-attention ;;
|
|
f5-screen) fusion=audio-person-frame-set ;;
|
|
f6-screen) fusion=gated-person-state-adapter ;;
|
|
esac
|
|
for seed in "${seeds[@]}"; do
|
|
checkpoint="$CHECKPOINT_ROOT/${variant}_seed${seed}.pth"
|
|
result="$RESULT_ROOT/${variant}_seed${seed}"
|
|
if [[ -e "$checkpoint" || -e "$result/metrics.json" ]]; then
|
|
echo "Refusing to overwrite $checkpoint or $result; select new output roots." >&2
|
|
exit 1
|
|
fi
|
|
echo "Training ${variant} (${fusion}), seed=${seed}"
|
|
python train_turn_head.py \
|
|
--feature-root "$FEATURE_ROOT" \
|
|
--target-root "$TARGET_ROOT" \
|
|
--local-feature-root "$LOCAL_ROOT" \
|
|
--local-modalities av \
|
|
--local-fusion "$fusion" \
|
|
--local-projection-dim "$LOCAL_PROJECTION_DIM" \
|
|
--person-attention-dim "$PERSON_ATTENTION_DIM" \
|
|
--person-attention-heads "$PERSON_ATTENTION_HEADS" \
|
|
--output "$checkpoint" \
|
|
--sessions 4 5 6 7 8 9 10 11 12 \
|
|
--dev-sessions 12 \
|
|
--epochs "$EPOCHS" \
|
|
--batch-size 512 \
|
|
--learning-rate 7e-5 \
|
|
--weight-decay 5e-5 \
|
|
--warmup-epochs "$WARMUP_EPOCHS" \
|
|
--warmup-factor 0.3 \
|
|
--dropout 0.2 \
|
|
--loss lstr-mce \
|
|
--transition-objective none \
|
|
--layer-fusion concat-mlp \
|
|
--expected-mode open-stream-replay \
|
|
--seed "$seed" \
|
|
--device cuda:0
|
|
|
|
echo "Inferring ${variant}, seed=${seed}"
|
|
python infer_turn_head.py \
|
|
--feature-root "$FEATURE_ROOT" \
|
|
--target-root "$TARGET_ROOT" \
|
|
--local-feature-root "$LOCAL_ROOT" \
|
|
--checkpoint "$checkpoint" \
|
|
--output-dir "$result" \
|
|
--sessions 3 2 1 \
|
|
--expected-mode open-stream-replay \
|
|
--device cuda:0
|
|
done
|
|
done
|
|
|
|
if [[ "$SUMMARIZE" == 1 ]]; then
|
|
python summarize_local_baselines.py \
|
|
--root "$RESULT_ROOT" \
|
|
--dataset easycom \
|
|
--protocol causal_valid_only
|
|
fi
|