bertose-affinose-training-code / code /contrastive_training /step3_train_v51_FIXED_FINAL.sh
supanthadey1's picture
Add BERTose and AFFINose training code release
1d6f391 verified
Raw
History Blame Contribute Delete
1.97 kB
#!/bin/bash
#SBATCH --job-name=v51_FIXED
#SBATCH --partition=nova
#SBATCH --nodes=1
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=16
#SBATCH --mem=369G
#SBATCH --gres=gpu:1
#SBATCH --time=48:00:00
#SBATCH --output=v51_FIXED_final_%j.out
#SBATCH --error=v51_FIXED_final_%j.err
echo "==========================================================="
echo "V5.1-FIXED FINAL: Contrastive Training"
echo "==========================================================="
echo "Job ID: $SLURM_JOB_ID"
echo "Started: $(date)"
echo ""
echo "Configuration:"
echo " Positives: 161,906"
echo " Negatives: 150,000 (100K rule + 50K model)"
echo " Loss: 80% MLM + 20% InfoNCE"
echo " Temperature: 0.1 -> 0.05 (cosine)"
echo " Curriculum: Easy -> Mixed -> Hard"
echo ""
echo "Bugs Fixed (vs original V5.1):"
echo " - WURCS patterns for Sialic acid (a2122h, a2212h)"
echo " - All 8 biological rules working"
echo " - Model-based negatives included"
echo " - 0% overlap with positives verified"
echo "==========================================================="
source ~/.bashrc
conda activate glycanml
BASE="/work/ratul1/supantha/glycan-SD-VS/bert_training_v3/v3.1_cluster_training"
cd $BASE/bert_v5.1_contrastive
# Run training with FIXED data
python training/contrastive_trainer_v3_FIXED.py \
--model_path "$BASE/checkpoints_v5_bpe_topo/best_v5_bpe_topo_model.pt" \
--positives_path "$BASE/bert_v5.1_contrastive/data/fully_resolved_161k.pkl" \
--negatives_path "$BASE/bert_v5.1_contrastive/data/hard_negatives_150k_ALL_FINAL.pkl" \
--output_dir "$BASE/bert_v5.1_contrastive/checkpoints_V51_FIXED_FINAL" \
--epochs 50 \
--batch_size 16 \
--lr 2e-5 \
--mlm_weight 0.8 \
--contrastive_weight 0.2 \
--n_neg 5 \
--save_interval 5
echo ""
echo "==========================================================="
echo "V5.1-FIXED FINAL: Training Complete"
echo "Finished: $(date)"
echo "==========================================================="