generateAndTrain_maxwell_custom_center.sh 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #! bin/bash
  2. if [ -z "$1" ]
  3. then
  4. echo "No argument supplied"
  5. echo "Need of vector size"
  6. exit 1
  7. fi
  8. if [ -z "$2" ]
  9. then
  10. echo "No argument supplied"
  11. echo "Need of feature information"
  12. exit 1
  13. fi
  14. result_filename="results/models_comparisons.csv"
  15. VECTOR_SIZE=200
  16. size=$1
  17. feature=$2
  18. # selection of four scenes (only maxwell)
  19. scenes="A, D, G, H"
  20. start=0
  21. end=$size
  22. for nb_zones in {4,6,8,10,12}; do
  23. for mode in {"svd","svdn","svdne"}; do
  24. for model in {"svm_model","ensemble_model","ensemble_model_v2"}; do
  25. FILENAME="data/${model}_N${size}_B${start}_E${end}_nb_zones_${nb_zones}_${feature}_${mode}"
  26. MODEL_NAME="${model}_N${size}_B${start}_E${end}_nb_zones_${nb_zones}_${feature}_${mode}"
  27. CUSTOM_MIN_MAX_FILENAME="N${size}_B${start}_E${end}_nb_zones_${nb_zones}_${feature}_${mode}_min_max"
  28. echo $FILENAME
  29. # only compute if necessary (perhaps server will fall.. Just in case)
  30. if grep -q "${MODEL_NAME}" "${result_filename}"; then
  31. echo "${MODEL_NAME} results already generated..."
  32. else
  33. python generate/generate_data_model_random_center.py --output ${FILENAME} --interval "${start},${end}" --kind ${mode} --feature ${feature} --scenes "${scenes}" --nb_zones "${nb_zones}" --percent 1 --renderer "maxwell" --step 10 --random 1 --custom ${CUSTOM_MIN_MAX_FILENAME}
  34. python train_model.py --data ${FILENAME} --output ${MODEL_NAME} --choice ${model}
  35. #python prediction/predict_seuil_expe_maxwell.py --interval "${start},${end}" --model "saved_models/${MODEL_NAME}.joblib" --mode "${mode}" --feature ${feature} --limit_detection '2' --custom ${CUSTOM_MIN_MAX_FILENAME}
  36. python others/save_model_result_in_md_maxwell.py --interval "${start},${end}" --model "saved_models/${MODEL_NAME}.joblib" --mode "${mode}" --feature ${feature}
  37. fi
  38. done
  39. done
  40. done