File size: 1,942 Bytes
7c61ee6 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | # Unfrozen fMRI side: single-subject vs multi-subject fine-tuning, + frozen-encoder control; then one-shot test
# generation with the val-chosen no-label setting (coef_rescaled, CFG 50), evaluation and identification.
source /home/hubin/venvs/trellis/bin/activate
cd /home/hubin/trellis_work
O=/home/hubin/trellis_work/outputs/ft
T="python mapper/train_ft.py --k 16"
CUDA_VISIBLE_DEVICES=0 $T --out_dir $O/single_0001 --subjects 0001 > $O/single_0001.log 2>&1 &
CUDA_VISIBLE_DEVICES=0 $T --out_dir $O/single_0002 --subjects 0002 > $O/single_0002.log 2>&1 &
CUDA_VISIBLE_DEVICES=0 $T --out_dir $O/single_0003 --subjects 0003 > $O/single_0003.log 2>&1 &
CUDA_VISIBLE_DEVICES=1 $T --out_dir $O/multi_010203 --subjects 0001 0002 0003 --steps 6000 > $O/multi_010203.log 2>&1 &
CUDA_VISIBLE_DEVICES=1 $T --out_dir $O/frozen_0001 --subjects 0001 --n_train_blocks 0 --freeze_patch > $O/frozen_0001.log 2>&1 &
wait
echo TRAIN_DONE
C=50
D0=""; D1=""; n=0
for r in single_0001 single_0002 single_0003 multi_010203 frozen_0001; do
for s in $(ls -d $O/$r/sub* | xargs -n1 basename); do
d=$O/$r/$s/test_coef_rescaled_cfg$C; mkdir -p $d; ln -sf $O/$r/$s/test/coef_rescaled/tokens.npy $d/tokens.npy
if [ $((n % 2)) -eq 0 ]; then D0="$D0 $d"; else D1="$D1 $d"; fi; n=$((n + 1))
done
done
for w in 0 1; do
CUDA_VISIBLE_DEVICES=0 python gen_from_tokens.py --variant_dirs $D0 --cfg $C --shard $w --num_shards 2 > $O/gen_a_w$w.log 2>&1 &
CUDA_VISIBLE_DEVICES=1 python gen_from_tokens.py --variant_dirs $D1 --cfg $C --shard $w --num_shards 2 > $O/gen_b_w$w.log 2>&1 &
done
wait
M=""
for d in $D0 $D1; do
OMP_NUM_THREADS=8 OPENBLAS_NUM_THREADS=8 MKL_NUM_THREADS=8 python eval_shape.py --gen_dir $d/meshes --out $d/metrics.json > $d/eval.log 2>&1 &
M="$M ft_$(echo ${d#$O/} | tr / _)=$d/meshes"
done
wait
CUDA_VISIBLE_DEVICES=1 python ident_eval.py --out_dir /home/hubin/trellis_work/outputs/ident --methods $M > $O/ident.log 2>&1
echo FT_DONE
|