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.

76 lines
2.1 KiB

11 months ago
11 months ago
11 months ago
11 months ago
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. #cpu=nehalem192g0
  7. cpu=epyc512g0
  8. gpu=i9-64g0
  9. #cpu=haswell378g0
  10. env=$4
  11. shielding=$5
  12. num_steps=$1
  13. experiment_log_dir="${2}"
  14. num_evaluations=$3
  15. shield_value=$6
  16. prism_config=$7
  17. prob_next=$8
  18. prob_direct=$9
  19. prob_forward="${10}"
  20. shield_comparision="${11}"
  21. NUM_GPUS="1"
  22. exp_name="${commit_message}-${datetime}-env:${env}-sh:${shielding}-value:${shield_value}-comp:${shield_comparision}-prob:${prob_forward}"
  23. experiment_log_dir="${2}/${exp_name}"
  24. MINIGRID_BINARY=""
  25. if [ "$(whoami)" = "spranger" ]; then
  26. MINIGRID_BINARY="/workstore/spranger/tempestpy/Minigrid2PRISM/build/main"
  27. else
  28. MINIGRID_BINARY="/workstore/tknoll/Minigrid2PRISM/build/main"
  29. fi
  30. # echo $experiment_log_dir
  31. # echo $(pwd)
  32. # echo $(pwd)/$experiment_log_dir/$exp_name
  33. # 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}" &
  34. set -x
  35. srun -w $gpu python3 examples/shields/rl/15_train_eval_tune.py --env $4 \
  36. --shielding $5 \
  37. --steps $1 \
  38. --expname "$exp_name" \
  39. --log_dir "$experiment_log_dir" \
  40. --evaluations $3 \
  41. --grid_to_prism_binary_path $MINIGRID_BINARY \
  42. --shield_comparision $6 \
  43. --prism_config $7 \
  44. --prob_next $8 \
  45. --prob_direct $9 \
  46. --prob_forward "${10}" \
  47. --shield_comparision $6 \
  48. --shield_value "${11}" \
  49. --num_gpus ${NUM_GPUS} &
  50. set +x
  51. sleep 20
  52. rsync -avtr --stats $(pwd)/$experiment_log_dir/$exp_name tensorboard:/media/data1/easy_rl_tb_logs
  53. sleep 60
  54. while [[ -n $(jobs -r) ]]; do
  55. rsync -avtr --append --stats $(pwd)/$experiment_log_dir/$exp_name tensorboard:/media/data1/easy_rl_tb_logs
  56. sleep 60;
  57. done
  58. rsync -avtr --append --stats $(pwd)/$experiment_log_dir/$exp_name tensorboard:/media/data1/easy_rl_tb_logs
  59. #!/bin/bash
  60. . ../env/bin/activate