run_maxwell_simulation_filters_statistics_opti.sh 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #! bin/bash
  2. # file which contains model names we want to use for simulation
  3. list="attributes, filters"
  4. if [ -z "$1" ]
  5. then
  6. echo "No argument supplied"
  7. echo "Need argument from [${list}]"
  8. exit 1
  9. fi
  10. # selection of four scenes (only maxwell)
  11. scenes="A, D, G, H"
  12. size="26"
  13. feature="filters_statistics"
  14. filter=$1
  15. simulate_models="simulate_models_${filter}_all.csv"
  16. for nb_zones in {4,6,8,10,12}; do
  17. for mode in {"svd","svdn","svdne"}; do
  18. for model in {"svm_model","ensemble_model","ensemble_model_v2"}; do
  19. for data in {"all","center","split"}; do
  20. FILENAME="data/${model}_N${size}_B0_E${size}_nb_zones_${nb_zones}_${feature}_${mode}_${data}_${filter}"
  21. MODEL_NAME="${model}_N${size}_B0_E${size}_nb_zones_${nb_zones}_${feature}_${mode}_${data}_${filter}"
  22. CUSTOM_MIN_MAX_FILENAME="N${size}_B0_E${size}_nb_zones_${nb_zones}_${feature}_${mode}_${data}_${filter}_min_max"
  23. # only compute if necessary (perhaps server will fall.. Just in case)
  24. if grep -q "${FILENAME}" "${simulate_models}"; then
  25. echo "Found ${FILENAME}"
  26. line=$(grep -n ${FILENAME} ${simulate_models})
  27. # extract solution
  28. IFS=\; read -a fields <<<"$line"
  29. SOLUTION=${fields[1]}
  30. echo "Run simulation for ${MODEL_NAME}... with ${SOLUTION}"
  31. # Use of already generated model
  32. 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}
  33. python train_model_${filter}.py --data ${FILENAME} --output ${MODEL_NAME} --choice ${model} --solution "${SOLUTION}"
  34. python prediction/predict_seuil_expe_maxwell_curve_opti.py --solution "${SOLUTION}" --model "saved_models/${MODEL_NAME}.joblib" --mode "${mode}" --feature ${feature} --custom ${CUSTOM_MIN_MAX_FILENAME} --filter ${filter}
  35. #python others/save_model_result_in_md_maxwell.py --solution "${SOLUTION}" --model "saved_models/${MODEL_NAME}.joblib" --mode "${mode}" --feature ${feature}
  36. fi
  37. done
  38. done
  39. done
  40. done