run_maxwell_simulation.sh 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #! bin/bash
  2. # file which contains model names we want to use for simulation
  3. simulate_models="simulate_models.csv"
  4. # selection of four scenes (only maxwell)
  5. scenes="A, D, G, H"
  6. for size in {"4","8","16","26","32","40"}; do
  7. for metric in {"lab","mscn","mscn_revisited","low_bits_2","low_bits_3","low_bits_4"}; do
  8. half=$(($size/2))
  9. start=-$half
  10. for counter in {0..4}; do
  11. end=$(($start+$size))
  12. if [ "$end" -gt "$VECTOR_SIZE" ]; then
  13. start=$(($VECTOR_SIZE-$size))
  14. end=$(($VECTOR_SIZE))
  15. fi
  16. if [ "$start" -lt "0" ]; then
  17. start=$((0))
  18. end=$(($size))
  19. fi
  20. for nb_zones in {4,6,8,10,12,14}; do
  21. echo $start $end
  22. for mode in {"svd","svdn","svdne"}; do
  23. for model in {"svm_model","ensemble_model","ensemble_model_v2"}; do
  24. MODEL_NAME="${model}_N${size}_B${start}_E${end}_nb_zones_${nb_zones}_${metric}_${mode}"
  25. if grep -q "${MODEL_NAME}" "${simulate_models}"; then
  26. echo "Run simulation for model ${MODEL_NAME}"
  27. python predict_seuil_expe_maxwell.py --interval "${start},${end}" --model "saved_models/${MODEL_NAME}.joblib" --mode "${mode}" --metric ${metric} --limit_detection '2'
  28. fi
  29. done
  30. done
  31. done
  32. if [ "$counter" -eq "0" ]; then
  33. start=$(($start+50-$half))
  34. else
  35. start=$(($start+50))
  36. fi
  37. done
  38. done
  39. done