run_tl_test.sh 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #!/bin/bash
  2. erased=$1
  3. # file which contains model names we want to use for simulation
  4. file_path="results/models_comparisons.csv"
  5. if [ "${erased}" == "Y" ]; then
  6. echo "Previous data file erased..."
  7. rm ${file_path}
  8. mkdir -p results
  9. touch ${file_path}
  10. # add of header
  11. echo 'model_name; global_train_size; global_test_size; filtered_train_size; filtered_test_size; f1_train; f1_test; recall_train; recall_test; presicion_train; precision_test; acc_train; acc_test; roc_auc_train; roc_auc_test;' >> ${file_path}
  12. fi
  13. renderer="all"
  14. scenes="A, B, C, D, E, F, G, H, I"
  15. svd_metric="svd_reconstruction"
  16. ipca_metric="ipca_reconstruction"
  17. fast_ica_metric="fast_ica_reconstruction"
  18. all_features="${svd_metric},${ipca_metric},${fast_ica_metric}"
  19. # RUN LATER
  20. # compute using all transformation methods
  21. ipca_batch_size=55
  22. begin=100
  23. end=200
  24. ipca_component=30
  25. fast_ica_component=60
  26. zone=12
  27. OUTPUT_DATA_FILE="${svd_metric}_B${begin}_E${end}_${ipca_metric}__N${ipca_component}_BS${ipca_batch_size}_${fast_ica_metric}_N${fast_ica_component}_nb_zones_${zone}"
  28. python generate/generate_reconstructed_data.py --features ${svd_metric} --params "${begin}, ${end}"
  29. python generate/generate_reconstructed_data.py --features ${ipca_component} --params "${component},${ipca_batch_size}"
  30. python generate/generate_reconstructed_data.py --features ${fast_ica_component} --params "${component}"
  31. if grep -xq "${OUTPUT_DATA_FILE}" "${file_path}"; then
  32. echo "Transformation combination model ${OUTPUT_DATA_FILE} already generated"
  33. else
  34. echo "Run computation for Transformation combination model ${OUTPUT_DATA_FILE}"
  35. params="${begin}, ${end} :: ${ipca_component}, ${ipca_batch_size} :: ${fast_ica_component}"
  36. python generate/generate_dataset.py --output data/${OUTPUT_DATA_FILE} --metric ${all_features} --renderer ${renderer} --scenes ${scenes} --params "${params}" --nb_zones ${zone} --random 1
  37. python train_model.py --data data/${OUTPUT_DATA_FILE} --output ${OUTPUT_DATA_FILE} --tl 1 &
  38. fi