fhyfhy's picture
Add code-release/
3970207 verified
Raw History Blame Contribute Delete
1.36 kB
#!/usr/bin/env bash
# Symbolic three-hop task (Appendix A.2 / Figure 5): K=3, 5000 epochs, 1,000 test
# chains per hop count and split.
# discoloop DiscoLoop with a fixed gate (alpha=1, beta=0)
# vanilla vanilla looped transformer
# noloop non-looped baseline: 3 untied copies of the blocks (stacking)
#
# Usage: scripts/symbolic_3hop.sh {discoloop|vanilla|noloop} [train_twin_hyper.sh options]
# e.g. scripts/symbolic_3hop.sh discoloop --gpu 3 --seed 15
set -euo pipefail
cd "$(dirname "${BASH_SOURCE[0]}")/.."
case "${1:-}" in
discoloop) MODEL_ARGS=(--design looping --loop-scheme discoloop --num-stages 3 --gate-mode fixed --fixed-alpha 1 --fixed-beta 0) ;;
vanilla) MODEL_ARGS=(--design looping --loop-scheme vanillaloop --num-stages 3) ;;
noloop) MODEL_ARGS=(--design stacking --loop-scheme vanillaloop --num-stages 3) ;;
*)
echo "Usage: $0 {discoloop|vanilla|noloop} [train_twin_hyper.sh options]" >&2
exit 1
;;
esac
shift
# The dataset ships its own test_id.json / test_ood.json, so there is no train/test
# split of train.json (--train-twohop-count -1).
exec ./train_twin_hyper.sh \
--data data/twin_23hop_truood_diff.500.50.10 \
--max-length 5 \
--train-twohop-count -1 \
--eval-id-count 1000 \
--eval-ood-count 1000 \
--epochs 5000 \
--loss-compute-method answer \
"${MODEL_ARGS[@]}" \
"$@"