run_keras.sh 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. # erase "results/models_comparisons.csv" file and write new header
  2. file_path='results/models_comparisons_keras.csv'
  3. erased=$1
  4. if [ "${erased}" == "Y" ]; then
  5. echo "Previous data file erased..."
  6. rm ${file_path}
  7. mkdir -p models_info
  8. touch ${file_path}
  9. # add of header
  10. echo 'model_name; number_of_approximations; coeff_of_determination; MSE 10 samples; MSE 1000 samples;' >> ${file_path}
  11. fi
  12. for feature in {'variances','samples'}; do
  13. for n in {3,4,5,6,7,8,9,10,15,20,25,30}; do
  14. for row in {1,2,3,4,5}; do
  15. for column in {1,2,3,4,5}; do
  16. # Run creation of dataset and train model
  17. DATASET_NAME="data/dataset_${n}_${feature}_column_${column}_row_${row}.csv"
  18. MODEL_NAME="${n}_${feature}_column_${column}_row_${row}"
  19. IMAGE_RECONSTRUCTED="Sponza1_${n}_${feature}_${row}_${column}.png"
  20. DATA_INFO="${n}_${feature}_column_${column}_row_${row}"
  21. if grep -q "${MODEL_NAME}" "${file_path}"; then
  22. echo "${MODEL_NAME} results already computed.."
  23. else
  24. echo "Run computation for model ${MODEL_NAME}"
  25. # Already computed..
  26. python generate/make_dataset.py --n ${n} --feature ${feature} --each_row ${row} --each_column ${column}
  27. python train_model_keras.py --data ${DATASET_NAME} --model_name ${MODEL_NAME}
  28. # TODO : Add of reconstruct process for image ?
  29. python reconstruct/reconstruct_keras.py --n ${n} --feature ${feature} --model_path saved_models/${MODEL_NAME}.json --scene Sponza1 --image_name ${IMAGE_RECONSTRUCTED}
  30. python others/write_result_keras.py --n ${n} --model_path saved_models/${MODEL_NAME}.json --scene Sponza1 --image_path reconstructed/${IMAGE_RECONSTRUCTED} --data ${DATASET_NAME} --iqa mse &
  31. fi
  32. done
  33. done
  34. done
  35. done