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.

71 lines
2.2 KiB

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