generateAndTrain_maxwell_custom_optimization.sh 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. if [ -z "$3" ]
  15. then
  16. echo "No argument supplied"
  17. echo "Need of kind of data to use"
  18. exit 1
  19. fi
  20. if [ -z "$4" ]
  21. then
  22. echo "No argument supplied"
  23. echo "Use of filters or attributes"
  24. exit 1
  25. fi
  26. size=$1
  27. feature=$2
  28. data=$3
  29. filter=$4
  30. # selection of four scenes (only maxwell)
  31. scenes="A, D, G, H"
  32. result_filename="results/optimization_comparisons_${filter}.csv"
  33. start=0
  34. end=$size
  35. #for nb_zones in {4,6,8,10,12}; do
  36. for nb_zones in {10,12}; do
  37. for mode in {"svd","svdn","svdne"}; do
  38. for model in {"svm_model","ensemble_model","ensemble_model_v2"}; do
  39. FILENAME="data/${model}_N${size}_B${start}_E${end}_nb_zones_${nb_zones}_${feature}_${mode}_${data}_${filter}"
  40. MODEL_NAME="${model}_N${size}_B${start}_E${end}_nb_zones_${nb_zones}_${feature}_${mode}_${data}_${filter}"
  41. CUSTOM_MIN_MAX_FILENAME="N${size}_B${start}_E${end}_nb_zones_${nb_zones}_${feature}_${mode}_${data}_${filter}_min_max"
  42. echo $FILENAME
  43. # only compute if necessary (perhaps server will fall.. Just in case)
  44. if grep -q "${MODEL_NAME}" "${result_filename}"; then
  45. echo "${MODEL_NAME} results already generated..."
  46. else
  47. python generate/generate_data_model_random_${data}.py --output ${FILENAME} --interval "${start},${end}" --kind ${mode} --feature ${feature} --scenes "${scenes}" --nb_zones "${nb_zones}" --percent 1 --renderer "maxwell" --step 40 --random 1 --custom ${CUSTOM_MIN_MAX_FILENAME}
  48. echo "Train ${MODEL_NAME}"
  49. python find_best_${filter}.py --data ${FILENAME} --choice ${model} &
  50. fi
  51. done
  52. done
  53. done