run_maxwell_simulation_filters_statistics_all.sh 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #! bin/bash
  2. # file which contains model names we want to use for simulation
  3. simulate_models="simulate_models_all.csv"
  4. # selection of four scenes (only maxwell)
  5. scenes="A, D, G, H"
  6. size="26"
  7. feature="filters_statistics"
  8. for nb_zones in {4,6,8,10,12}; do
  9. for mode in {"svd","svdn","svdne"}; do
  10. for model in {"svm_model","ensemble_model","ensemble_model_v2"}; do
  11. for data in {"all","center","split"}; do
  12. FILENAME="data/${model}_N${size}_B0_E${size}_nb_zones_${nb_zones}_${feature}_${mode}_${data}"
  13. MODEL_NAME="${model}_N${size}_B0_E${size}_nb_zones_${nb_zones}_${feature}_${mode}_${data}"
  14. CUSTOM_MIN_MAX_FILENAME="N${size}_B0_E${size}_nb_zones_${nb_zones}_${feature}_${mode}_${data}_min_max"
  15. # only compute if necessary (perhaps server will fall.. Just in case)
  16. if grep -q "${FILENAME}" "${simulate_models}"; then
  17. echo "Found ${FILENAME}"
  18. line=$(grep -n ${FILENAME} ${simulate_models})
  19. # extract solution
  20. IFS=\; read -a fields <<<"$line"
  21. SOLUTION=${fields[1]}
  22. echo "Run simulation for ${MODEL_NAME}... with ${SOLUTION}"
  23. # Use of already generated model
  24. python generate/generate_data_model_random_${data}.py --output ${FILENAME} --interval "0,${size}" --kind ${mode} --feature ${feature} --scenes "${scenes}" --nb_zones "${nb_zones}" --percent 1 --renderer "maxwell" --step 10 --random 1 --custom ${CUSTOM_MIN_MAX_FILENAME}
  25. python train_model_filters.py --data ${FILENAME} --output ${MODEL_NAME} --choice ${model} --solution "${SOLUTION}"
  26. python prediction/predict_seuil_expe_maxwell_curve_filters.py --solution "${SOLUTION}" --model "saved_models/${MODEL_NAME}.joblib" --mode "${mode}" --feature ${feature} --custom ${CUSTOM_MIN_MAX_FILENAME}
  27. #python others/save_model_result_in_md_maxwell.py --solution "${SOLUTION}" --model "saved_models/${MODEL_NAME}.joblib" --mode "${mode}" --feature ${feature}
  28. fi
  29. done
  30. done
  31. done
  32. done