Initial release: code for WCL2026-1544 (context-aware embedding masking via DRL)

This commit is contained in:
Ki-Ho Lee
2026-06-22 17:31:32 +09:00
commit 8b7f70d650
26 changed files with 3445 additions and 0 deletions
Executable
+65
View File
@@ -0,0 +1,65 @@
#!/bin/bash
# Batch runner for U-sweep and ablations on real BERT embeddings.
# Each run uses 60 epochs x 150 steps (~5 min on MPS).
# Outputs saved under results_drl/ with per-run subdirs.
set -e
BASE="/Users/kyo/Documents/AY/논문/5. WCL-DRL"
cd "$BASE"
EMB="bert_agnews_8000.pt"
EPOCHS=60
STEPS=150
PY="/opt/anaconda3/bin/python"
mkdir -p results_sweeps
echo "=== U-sweep: DRL ==="
for U in 1 2 3 5 6; do
echo ">>> DRL U=$U"
$PY Code/drl_mask_policy.py \
--mode drl --embed-file $EMB \
--users $U --mux-factor 4 \
--epochs $EPOCHS --steps-per-epoch $STEPS \
--save-dir results_sweeps/drl_U${U} \
2>&1 | tail -3
done
echo "=== U-sweep: Joint ==="
for U in 1 2 3 5 6; do
echo ">>> Joint U=$U"
$PY Code/drl_mask_policy.py \
--mode joint --embed-file $EMB \
--users $U --mux-factor 4 \
--epochs $EPOCHS --steps-per-epoch $STEPS \
--save-dir results_sweeps/joint_U${U} \
2>&1 | tail -3
done
echo "=== Ablation: beta=0 (no orthogonality reward) ==="
$PY Code/drl_mask_policy.py \
--mode drl --embed-file $EMB \
--users 4 --mux-factor 4 --beta 0.0 \
--epochs $EPOCHS --steps-per-epoch $STEPS \
--save-dir results_sweeps/drl_beta0 \
2>&1 | tail -3
echo "=== Ablation: r=16 (smaller rank) ==="
$PY Code/drl_mask_policy.py \
--mode drl --embed-file $EMB \
--users 4 --mux-factor 4 --rank 16 \
--epochs $EPOCHS --steps-per-epoch $STEPS \
--save-dir results_sweeps/drl_r16 \
2>&1 | tail -3
echo "=== Ablation: r=d_s=3072 (full rank) ==="
$PY Code/drl_mask_policy.py \
--mode drl --embed-file $EMB \
--users 4 --mux-factor 4 --rank 3072 \
--epochs $EPOCHS --steps-per-epoch $STEPS \
--save-dir results_sweeps/drl_rfull \
2>&1 | tail -3
echo "=== All sweeps complete ==="
ls -la results_sweeps/