cross_run.sh 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. min_diff_metric="min_diff_filter"
  2. svd_metric="svd_reconstruction"
  3. ipca_metric="ipca_reconstruction"
  4. fast_ica_metric="fast_ica_reconstruction"
  5. scenes="A,B,D,G,H,I"
  6. all_scenes="A,B,C,D,E,F,G,H,I"
  7. # file which contains model names we want to use for simulation
  8. file_path="results/models_comparisons.csv"
  9. stride=1
  10. # for window in {"3","5","7","9"}; do
  11. # echo python generate/generate_reconstructed_data.py --features ${metric} --params ${window},${window},${stride} --size 100,100 --scenes ${all_scenes}
  12. # done
  13. for scene in {"A","B","D","G","H","I"}; do
  14. # remove current scene test from dataset
  15. s="${scenes//,${scene}}"
  16. s="${s//${scene},}"
  17. for zone in {10,11,12}; do
  18. for window in {"3","5","7","9"}; do
  19. for balancing in {0,1}; do
  20. OUTPUT_DATA_FILE="${min_diff_metric}_nb_zones_${zone}_W${window}_S${stride}_balancing${balancing}_without_${scene}"
  21. OUTPUT_DATA_FILE_TEST="${min_diff_metric}_nb_zones_${zone}_W${window}_S${stride}_balancing${balancing}_scene_${scene}"
  22. if grep -q "${OUTPUT_DATA_FILE}" "${file_path}"; then
  23. echo "SVD model ${OUTPUT_DATA_FILE} already generated"
  24. else
  25. #echo "Run computation for SVD model ${OUTPUT_DATA_FILE}"
  26. echo python generate/generate_dataset.py --output data/${OUTPUT_DATA_FILE_TEST} --features ${min_diff_metric} --scenes ${scene} --params ${window},${window},${stride} --nb_zones ${zone} --random 1 --size 100,100
  27. echo python generate/generate_dataset.py --output data/${OUTPUT_DATA_FILE} --features ${min_diff_metric} --scenes ${s} --params ${window},${window},${stride} --nb_zones ${zone} --random 1 --size 100,100
  28. echo python train_model.py --data data/${OUTPUT_DATA_FILE} --output ${OUTPUT_DATA_FILE} --balancing ${balancing}
  29. echo python prediction_model.py --data data/${OUTPUT_DATA_FILE_TEST}.train --model saved_models/${OUTPUT_DATA_FILE}.json
  30. fi
  31. done
  32. done
  33. done
  34. done
  35. # First compute svd_reconstruction
  36. for scene in {"A","B","D","G","H","I"}; do
  37. # remove current scene test from dataset
  38. s="${scenes//,${scene}}"
  39. s="${s//${scene},}"
  40. for begin in {80,85,90,95,100,105,110}; do
  41. for end in {150,160,170,180,190,200}; do
  42. # echo python generate/generate_reconstructed_data.py --features ${svd_metric} --params ${begin},${end} --size 100,100 --scenes ${all_scenes}
  43. OUTPUT_DATA_FILE_TEST="${svd_metric}_scene_E_nb_zones_16_B${begin}_E${end}_scene_${scene}"
  44. echo python generate/generate_dataset.py --output data/${OUTPUT_DATA_FILE} --features ${svd_metric} --scenes ${scene} --params ${begin},${end} --nb_zones 16 --random 1 --size 100,100
  45. for zone in {10,11,12}; do
  46. for balancing in {0,1}; do
  47. OUTPUT_DATA_FILE="${svd_metric}_nb_zones_${zone}_B${begin}_E${end}_balancing${balancing}_without_${scene}"
  48. if grep -xq "${OUTPUT_DATA_FILE}" "${file_path}"; then
  49. echo "SVD model ${OUTPUT_DATA_FILE} already generated"
  50. else
  51. # echo "Run computation for SVD model ${OUTPUT_DATA_FILE}"
  52. echo python generate/generate_dataset.py --output data/${OUTPUT_DATA_FILE} --features ${svd_metric} --scenes ${s} --params ${begin},${end} --nb_zones ${zone} --random 1 --size 100,100
  53. echo python train_model.py --data data/${OUTPUT_DATA_FILE} --output ${OUTPUT_DATA_FILE} --balancing ${balancing}
  54. echo python prediction_model.py --data data/${OUTPUT_DATA_FILE_TEST}.train --model saved_models/${OUTPUT_DATA_FILE}.json
  55. fi
  56. done
  57. done
  58. done
  59. done
  60. done
  61. # computation of ipca_reconstruction
  62. ipca_batch_size=55
  63. for scene in {"A","B","D","G","H","I"}; do
  64. # remove current scene test from dataset
  65. s="${scenes//,${scene}}"
  66. s="${s//${scene},}"
  67. for component in {10,15,20,25,30,35,45,50}; do
  68. # echo python generate/generate_reconstructed_data.py --features ${ipca_metric} --params ${component},${ipca_batch_size} --size 100,100 --scenes ${all_scenes}
  69. OUTPUT_DATA_FILE_TEST="${ipca_metric}_scene_E_nb_zones_16_B${begin}_E${end}_scene_${scene}"
  70. echo python generate/generate_dataset.py --output data/${OUTPUT_DATA_FILE} --features ${ipca_metric} --scenes ${scene} --params ${component},${ipca_batch_size} --nb_zones 16 --random 1 --size 100,100
  71. for zone in {10,11,12}; do
  72. for balancing in {0,1}; do
  73. OUTPUT_DATA_FILE="${ipca_metric}_nb_zones_${zone}_N${component}_BS${ipca_batch_size}_balancing${balancing}_without_${scene}"
  74. if grep -xq "${OUTPUT_DATA_FILE}" "${file_path}"; then
  75. echo "IPCA model ${OUTPUT_DATA_FILE} already generated"
  76. else
  77. # echo "Run computation for IPCA model ${OUTPUT_DATA_FILE}"
  78. echo python generate/generate_dataset.py --output data/${OUTPUT_DATA_FILE} --features ${ipca_metric} --scenes ${s} --params ${component},${ipca_batch_size} --nb_zones ${zone} --random 1 --size 100,100
  79. echo python train_model.py --data data/${OUTPUT_DATA_FILE} --output ${OUTPUT_DATA_FILE} --balancing ${balancing}
  80. echo python prediction_model.py --data data/${OUTPUT_DATA_FILE_TEST}.train --model saved_models/${OUTPUT_DATA_FILE}.json
  81. fi
  82. done
  83. done
  84. done
  85. done
  86. # computation of fast_ica_reconstruction
  87. for scene in {"A","B","D","G","H","I"}; do
  88. # remove current scene test from dataset
  89. s="${scenes//,${scene}}"
  90. s="${s//${scene},}"
  91. for component in {50,60,70,80,90,100,110,120,130,140,150,160,170,180,190,200}; do
  92. # echo python generate/generate_reconstructed_data.py --features ${fast_ica_metric} --params ${component} --size 100,100 --scenes ${all_scenes}
  93. OUTPUT_DATA_FILE_TEST="${fast_ica_metric}_scene_E_nb_zones_16_B${begin}_E${end}_scene_${scene}"
  94. echo python generate/generate_dataset.py --output data/${OUTPUT_DATA_FILE} --features ${fast_ica_metric} --scenes ${scene} --params ${component} --nb_zones 16 --random 1 --size 100,100
  95. for zone in {10,11,12}; do
  96. for balancing in {0,1}; do
  97. OUTPUT_DATA_FILE="${fast_ica_metric}_nb_zones_${zone}_N${component}_without_${scene}"
  98. if grep -xq "${OUTPUT_DATA_FILE}" "${file_path}"; then
  99. echo "Fast ICA model ${OUTPUT_DATA_FILE} already generated"
  100. else
  101. # echo "Run computation for Fast ICA model ${OUTPUT_DATA_FILE}"
  102. echo python generate/generate_dataset.py --output data/${OUTPUT_DATA_FILE} --features ${fast_ica_metric} --scenes ${s} --params ${component} --nb_zones ${zone} --random 1 --size 100,100
  103. echo python train_model.py --data data/${OUTPUT_DATA_FILE} --output ${OUTPUT_DATA_FILE} --balancing ${balancing}
  104. echo python prediction_model.py --data data/${OUTPUT_DATA_FILE_TEST}.train --model saved_models/${OUTPUT_DATA_FILE}.json
  105. fi
  106. done
  107. done
  108. done
  109. done