DPACMAN / dpacman /scripts /run_train.sh
svincoff's picture
added dropout and overfit prevention
9da03b7
#!/bin/bash
# Manually specify values used in the config
main_task="train"
model_type="classifier"
timestamp=$(date "+%Y-%m-%d_%H-%M-%S")
run_dir="$HOME/DPACMAN/logs/${main_task}/${model_type}/runs/${timestamp}"
mkdir -p "$run_dir"
if [ -z "$WANDB_API_KEY" ]; then
read -s -p "Enter your WANDB API key: " wandb_key
echo
export WANDB_API_KEY="$wandb_key"
fi
CUDA_VISIBLE_DEVICES=0,1 nohup python -u -m scripts.train \
+trainer.strategy=ddp \
+trainer.use_distributed_sampler="false" \
+trainer.detect_anomaly="false" \
+trainer.gradient_clip_val=0.5 \
+trainer.gradient_clip_algorithm="norm" \
hydra.run.dir="${run_dir}" \
trainer.devices=2 \
trainer.max_epochs=10 \
data_module.train_file="/home/a03-svincoff/DPACMAN/dpacman/data_files/processed/splits/handpicked_val_test_cropTR4/train.csv" \
data_module.val_file="/home/a03-svincoff/DPACMAN/dpacman/data_files/processed/splits/handpicked_val_test_cropTR4/val.csv" \
data_module.test_file="/home/a03-svincoff/DPACMAN/dpacman/data_files/processed/splits/handpicked_val_test_cropTR4/test.csv" \
data_module.tr_shelf_path="data_files/processed/embeddings/fimo_hits_only/trs_esm.shelf" \
data_module.dna_shelf_path="data_files/processed/embeddings/fimo_hits_only/peaks_caduceus.shelf" \
data_module.batch_size=16 \
data_module.score_col="binary_scores" \
data_module.norm_value=1 \
model.loss_type="binary" \
model.glm_input_dim=256 \
model.compressed_dim=256 \
model.hidden_dim=256 \
model.dropout=0.2 \
model.lr=1e-5 \
> "${run_dir}/run.log" 2>&1 &
echo $! > "${run_dir}/pid.txt"