You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

54 lines
1.7 KiB

11 months ago
11 months ago
11 months ago
  1. #!/bin/bash
  2. . ../env/bin/activate
  3. commit_message="$(git log -1 --pretty=format:"%s_%h" | sed 's/\s/_/g')"
  4. git diff --quiet || commit_message="${commit_message}_dirty"
  5. datetime="$(date +%Y%-m-%dT%H:%M:%S)"
  6. exp_name="${commit_message}-${datetime}"
  7. experiment_log_dir="${2}/${exp_name}"
  8. #cpu=nehalem192g0
  9. cpu=opteron192g0
  10. #cpu=haswell378g0
  11. gpu=cuda
  12. env=$4
  13. shielding=$5
  14. num_steps=$1
  15. experiment_log_dir="${2}"
  16. num_evaluations=$3
  17. shield_value=$6
  18. prism_config=$7
  19. prob_next=$8
  20. prob_direct=$9
  21. prob_forward="${10}"
  22. shield_comparision="${11}"
  23. # echo $experiment_log_dir
  24. # echo $(pwd)
  25. # echo $(pwd)/$experiment_log_dir/$exp_name
  26. # python3 examples/shields/rl/11_minigridrl.py --expname "$exp_name" --steps "$1" --log_dir "$experiment_log_dir"/ --evaluations "$3" --env "$4" --shielding "$5" --shield_comparision "$6" --prism_config "$7" --prob_next "$8" --prob_direct "$9" --prob_forward "${10}" --shield_value "${11}" &
  27. set -x
  28. srun -w $cpu python3 examples/shields/rl/15_train_eval_tune.py --env $4 --shielding $5 --steps $1 --expname "$exp_name" --log_dir "$experiment_log_dir" --evaluations $3 --grid_to_prism_binary_path /workstore/tknoll/Minigrid2PRISM/build/main --shield_comparision $6 --prism_config $7 --prob_next $8 --prob_direct $9 --prob_forward "${10}" --shield_comparision $6 --shield_value "${11}" &
  29. set +x
  30. sleep 20
  31. rsync -avtr --stats $(pwd)/$experiment_log_dir/$exp_name tensorboard:/media/data1/easy_rl_tb_logs
  32. sleep 60
  33. while [[ -n $(jobs -r) ]]; do
  34. rsync -avtr --append --stats $(pwd)/$experiment_log_dir/$exp_name tensorboard:/media/data1/easy_rl_tb_logs
  35. sleep 60;
  36. done
  37. rsync -avtr --append --stats $(pwd)/$experiment_log_dir/$exp_name tensorboard:/media/data1/easy_rl_tb_logs
  38. #!/bin/bash
  39. . ../env/bin/activate