generateAndTrain_maxwell_custom_optimization.sh 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. start=0
  33. end=$size
  34. for nb_zones in {4,6,8,10,12}; do
  35. for mode in {"svd","svdn","svdne"}; do
  36. for model in {"svm_model","ensemble_model","ensemble_model_v2"}; do
  37. FILENAME="data/${model}_N${size}_B${start}_E${end}_nb_zones_${nb_zones}_${feature}_${mode}_${data}_${filter}"
  38. MODEL_NAME="${model}_N${size}_B${start}_E${end}_nb_zones_${nb_zones}_${feature}_${mode}_${data}_${filter}"
  39. CUSTOM_MIN_MAX_FILENAME="N${size}_B${start}_E${end}_nb_zones_${nb_zones}_${feature}_${mode}_${data}_${filter}_min_max"
  40. echo $FILENAME
  41. # only compute if necessary (perhaps server will fall.. Just in case)
  42. if grep -q "${MODEL_NAME}" "${result_filename}"; then
  43. echo "${MODEL_NAME} results already generated..."
  44. else
  45. 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}
  46. python find_best_${filter}.py --data ${FILENAME} --choice ${model}
  47. fi
  48. done
  49. done
  50. done