Quellcode durchsuchen

Run and simulation scripts updates

Jérôme BUISINE vor 5 Jahren
Ursprung
Commit
af1810e911

+ 6 - 12
README.md

@@ -8,12 +8,6 @@ Project developed during thesis in order to detect noise (perceptual noise) gene
 pip install -r requirements.txt
 ```
 
-Generate all needed data for each features (which requires the the whole dataset. In order to get it, you need to contact us).
-
-```bash
-python generate/generate_all_data.py --feature all
-```
-
 For noise detection, many features are available:
 - lab
 - mscn
@@ -45,6 +39,12 @@ For noise detection, many features are available:
 - highest_sv_entropy_std_filters
 - lowest_sv_entropy_std_filters
 
+Generate all needed data for each features (which requires the whole dataset. In order to get it, you need to contact us).
+
+```bash
+python generate/generate_all_data.py --feature all
+```
+
 You can also specify feature you want to compute and image step to avoid some images:
 ```bash
 python generate/generate_all_data.py --feature mscn --step 50
@@ -52,12 +52,6 @@ python generate/generate_all_data.py --feature mscn --step 50
 
 - **step**: keep only image if image id % 50 == 0 (assumption is that keeping spaced data will let model better fit).
 
-Or generate all data:
-
-```bash
-python generate/generate_all_data.py --feature all
-```
-
 ## Requirements
 
 ```

+ 1 - 1
run/runAll_maxwell.sh

@@ -8,7 +8,7 @@ erased=$1
 if [ "${erased}" == "Y" ]; then
     echo "Previous data file erased..."
     rm ${file_path}
-    mkdir -p models_info
+    mkdir -p results
     touch ${file_path}
 
     # add of header

+ 1 - 1
run/runAll_maxwell_area.sh

@@ -8,7 +8,7 @@ erased=$1
 if [ "${erased}" == "Y" ]; then
     echo "Previous data file erased..."
     rm ${file_path}
-    mkdir -p models_info
+    mkdir -p results
     touch ${file_path}
 
     # add of header

+ 1 - 1
run/runAll_maxwell_area_normed.sh

@@ -8,7 +8,7 @@ erased=$1
 if [ "${erased}" == "Y" ]; then
     echo "Previous data file erased..."
     rm ${file_path}
-    mkdir -p models_info
+    mkdir -p results
     touch ${file_path}
 
     # add of header

+ 1 - 1
run/runAll_maxwell_corr_custom.sh

@@ -8,7 +8,7 @@ erased=$1
 if [ "${erased}" == "Y" ]; then
     echo "Previous data file erased..."
     rm ${file_path}
-    mkdir -p models_info
+    mkdir -p results
     touch ${file_path}
 
     # add of header

+ 1 - 1
run/runAll_maxwell_custom.sh

@@ -8,7 +8,7 @@ erased=$1
 if [ "${erased}" == "Y" ]; then
     echo "Previous data file erased..."
     rm ${file_path}
-    mkdir -p models_info
+    mkdir -p results
     touch ${file_path}
 
     # add of header

+ 1 - 1
run/runAll_maxwell_custom_center.sh

@@ -8,7 +8,7 @@ erased=$1
 if [ "${erased}" == "Y" ]; then
     echo "Previous data file erased..."
     rm ${file_path}
-    mkdir -p models_info
+    mkdir -p results
     touch ${file_path}
 
     # add of header

+ 3 - 4
run/runAll_maxwell_custom_filters.sh

@@ -8,18 +8,17 @@ erased=$1
 if [ "${erased}" == "Y" ]; then
     echo "Previous data file erased..."
     rm ${file_path}
-    mkdir -p models_info
+    mkdir -p results
     touch ${file_path}
 
     # add of header
-    echo 'model_name; vector_size; start; end; nb_zones; metric; mode; tran_size; val_size; test_size; train_pct_size; val_pct_size; test_pct_size; train_acc; val_acc; test_acc; all_acc; F1_train; recall_train; roc_auc_train; F1_val; recall_val; roc_auc_val; F1_test; recall_test; roc_auc_test; F1_all; recall_all; roc_auc_all;' >> ${file_path}
+    echo 'model_name; vector_size; start; end; nb_zones; metric; mode; train_size; val_size; test_size; train_pct_size; val_pct_size; test_pct_size; train_acc; val_acc; test_acc; all_acc; F1_train; recall_train; roc_auc_train; F1_val; recall_val; roc_auc_val; F1_test; recall_test; roc_auc_test; F1_all; recall_all; roc_auc_all;' >> ${file_path}
 
 fi
 
 for size in {"4","8","16","26","32","40","60","80"}; do
 
-    # for metric in {"lab","mscn","low_bits_2","low_bits_3","low_bits_4","low_bits_5","low_bits_6","low_bits_4_shifted_2","ica_diff","svd_trunc_diff","ipca_diff","svd_reconstruct"}; do
-    for metric in {"highest_sv_std_filters","lowest_sv_std_filters","highest_wave_sv_std_filters","lowest_sv_std_filters","highest_sv_std_filters_full","lowest_sv_std_filters_full"}; do
+    for metric in {"highest_sv_std_filters","lowest_sv_std_filters","highest_wave_sv_std_filters","lowest_sv_std_filters","highest_sv_std_filters_full","lowest_sv_std_filters_full","highest_sv_entropy_std_filters","lowest_sv_entropy_std_filters"}; do
         bash data_processing/generateAndTrain_maxwell_custom_filters.sh ${size} ${metric} &
     done
 done

+ 3 - 4
run/runAll_maxwell_custom_filters_center.sh

@@ -8,18 +8,17 @@ erased=$1
 if [ "${erased}" == "Y" ]; then
     echo "Previous data file erased..."
     rm ${file_path}
-    mkdir -p models_info
+    mkdir -p results
     touch ${file_path}
 
     # add of header
-    echo 'model_name; vector_size; start; end; nb_zones; metric; mode; tran_size; val_size; test_size; train_pct_size; val_pct_size; test_pct_size; train_acc; val_acc; test_acc; all_acc; F1_train; recall_train; roc_auc_train; F1_val; recall_val; roc_auc_val; F1_test; recall_test; roc_auc_test; F1_all; recall_all; roc_auc_all;' >> ${file_path}
+    echo 'model_name; vector_size; start; end; nb_zones; metric; mode; train_size; val_size; test_size; train_pct_size; val_pct_size; test_pct_size; train_acc; val_acc; test_acc; all_acc; F1_train; recall_train; roc_auc_train; F1_val; recall_val; roc_auc_val; F1_test; recall_test; roc_auc_test; F1_all; recall_all; roc_auc_all;' >> ${file_path}
 
 fi
 
 for size in {"4","8","16","26","32","40","60","80"}; do
 
-    # for metric in {"lab","mscn","low_bits_2","low_bits_3","low_bits_4","low_bits_5","low_bits_6","low_bits_4_shifted_2","ica_diff","svd_trunc_diff","ipca_diff","svd_reconstruct"}; do
-    for metric in {"highest_sv_std_filters","lowest_sv_std_filters","highest_wave_sv_std_filters","lowest_sv_std_filters","highest_sv_std_filters_full","lowest_sv_std_filters_full"}; do
+    for metric in {"highest_sv_std_filters","lowest_sv_std_filters","highest_wave_sv_std_filters","lowest_sv_std_filters","highest_sv_std_filters_full","lowest_sv_std_filters_full","highest_sv_entropy_std_filters","lowest_sv_entropy_std_filters"}; do
         bash data_processing/generateAndTrain_maxwell_custom_filters_center.sh ${size} ${metric} &
     done
 done

+ 3 - 4
run/runAll_maxwell_custom_filters_split.sh

@@ -8,18 +8,17 @@ erased=$1
 if [ "${erased}" == "Y" ]; then
     echo "Previous data file erased..."
     rm ${file_path}
-    mkdir -p models_info
+    mkdir -p results
     touch ${file_path}
 
     # add of header
-    echo 'model_name; vector_size; start; end; nb_zones; metric; mode; tran_size; val_size; test_size; train_pct_size; val_pct_size; test_pct_size; train_acc; val_acc; test_acc; all_acc; F1_train; recall_train; roc_auc_train; F1_val; recall_val; roc_auc_val; F1_test; recall_test; roc_auc_test; F1_all; recall_all; roc_auc_all;' >> ${file_path}
+    echo 'model_name; vector_size; start; end; nb_zones; metric; mode; train_size; val_size; test_size; train_pct_size; val_pct_size; test_pct_size; train_acc; val_acc; test_acc; all_acc; F1_train; recall_train; roc_auc_train; F1_val; recall_val; roc_auc_val; F1_test; recall_test; roc_auc_test; F1_all; recall_all; roc_auc_all;' >> ${file_path}
 
 fi
 
 for size in {"4","8","16","26","32","40","60","80"}; do
 
-    #for metric in {"lab","mscn","low_bits_2","low_bits_3","low_bits_4","low_bits_5","low_bits_6","low_bits_4_shifted_2","ica_diff","svd_trunc_diff","ipca_diff","svd_reconstruct"}; do
-    for metric in {"highest_sv_std_filters","lowest_sv_std_filters","highest_wave_sv_std_filters","lowest_sv_std_filters","highest_sv_std_filters_full","lowest_sv_std_filters_full"}; do
+    for metric in {"highest_sv_std_filters","lowest_sv_std_filters","highest_wave_sv_std_filters","lowest_sv_std_filters","highest_sv_std_filters_full","lowest_sv_std_filters_full","highest_sv_entropy_std_filters","lowest_sv_entropy_std_filters"}; do
         bash data_processing/generateAndTrain_maxwell_custom_filters_split.sh ${size} ${metric} &
     done
 done

+ 1 - 1
run/runAll_maxwell_custom_filters_stats.sh

@@ -8,7 +8,7 @@ erased=$1
 if [ "${erased}" == "Y" ]; then
     echo "Previous data file erased..."
     rm ${file_path}
-    mkdir -p models_info
+    mkdir -p results
     touch ${file_path}
 
     # add of header

+ 1 - 1
run/runAll_maxwell_custom_filters_stats_center.sh

@@ -8,7 +8,7 @@ erased=$1
 if [ "${erased}" == "Y" ]; then
     echo "Previous data file erased..."
     rm ${file_path}
-    mkdir -p models_info
+    mkdir -p results
     touch ${file_path}
 
     # add of header

+ 1 - 1
run/runAll_maxwell_custom_filters_stats_split.sh

@@ -8,7 +8,7 @@ erased=$1
 if [ "${erased}" == "Y" ]; then
     echo "Previous data file erased..."
     rm ${file_path}
-    mkdir -p models_info
+    mkdir -p results
     touch ${file_path}
 
     # add of header

+ 1 - 1
run/runAll_maxwell_custom_split.sh

@@ -8,7 +8,7 @@ erased=$1
 if [ "${erased}" == "Y" ]; then
     echo "Previous data file erased..."
     rm ${file_path}
-    mkdir -p models_info
+    mkdir -p results
     touch ${file_path}
 
     # add of header

+ 1 - 1
run/runAll_maxwell_keras.sh

@@ -8,7 +8,7 @@ erased=$1
 if [ "${erased}" == "Y" ]; then
     echo "Previous data file erased..."
     rm ${file_path}
-    mkdir -p models_info
+    mkdir -p results
     touch ${file_path}
 
     # add of header

+ 1 - 1
run/runAll_maxwell_keras_corr.sh

@@ -8,7 +8,7 @@ erased=$1
 if [ "${erased}" == "Y" ]; then
     echo "Previous data file erased..."
     rm ${file_path}
-    mkdir -p models_info
+    mkdir -p results
     touch ${file_path}
 
     # add of header

+ 1 - 1
run/runAll_maxwell_keras_corr_custom.sh

@@ -8,7 +8,7 @@ erased=$1
 if [ "${erased}" == "Y" ]; then
     echo "Previous data file erased..."
     rm ${file_path}
-    mkdir -p models_info
+    mkdir -p results
     touch ${file_path}
 
     # add of header

+ 1 - 1
run/runAll_maxwell_mscn_var.sh

@@ -8,7 +8,7 @@ erased=$1
 if [ "${erased}" == "Y" ]; then
     echo "Previous data file erased..."
     rm ${file_path}
-    mkdir -p models_info
+    mkdir -p results
     touch ${file_path}
 
     # add of header

+ 1 - 1
run/runAll_maxwell_sub_blocks_stats.sh

@@ -8,7 +8,7 @@ erased=$1
 if [ "${erased}" == "Y" ]; then
     echo "Previous data file erased..."
     rm ${file_path}
-    mkdir -p models_info
+    mkdir -p results
     touch ${file_path}
 
     # add of header

+ 1 - 1
run/runAll_maxwell_sub_blocks_stats_reduced.sh

@@ -8,7 +8,7 @@ erased=$1
 if [ "${erased}" == "Y" ]; then
     echo "Previous data file erased..."
     rm ${file_path}
-    mkdir -p models_info
+    mkdir -p results
     touch ${file_path}
 
     # add of header

+ 2 - 2
simulation/run_maxwell_simulation_custom_filters.sh

@@ -28,8 +28,8 @@ for size in {"4","8","16","26","32","40"}; do
                     # only compute if necessary (perhaps server will fall.. Just in case)
                     if grep -q "${MODEL_NAME}" "${simulate_models}"; then
 
-                        echo "${MODEL_NAME} results already generated..."
-                    else
+                        echo "Run simulation for ${MODEL_NAME}..."
+
                         # Use of already generated model
                         # python generate/generate_data_model_random.py --output ${FILENAME} --interval "0,${size}" --kind ${mode} --feature ${feature} --scenes "${scenes}" --nb_zones "${nb_zones}" --percent 1 --renderer "maxwell" --step 40 --random 1 --custom ${CUSTOM_MIN_MAX_FILENAME}
                         # python train_model.py --data ${FILENAME} --output ${MODEL_NAME} --choice ${model}

+ 2 - 2
simulation/run_maxwell_simulation_filters_statistics.sh

@@ -24,8 +24,8 @@ for nb_zones in {4,6,8,10,12}; do
             # only compute if necessary (perhaps server will fall.. Just in case)
             if grep -q "${MODEL_NAME}" "${simulate_models}"; then
 
-                echo "${MODEL_NAME} results already generated..."
-            else
+                echo "Run simulation for ${MODEL_NAME}..."
+
                 # Use of already generated model
                 # python generate/generate_data_model_random.py --output ${FILENAME} --interval "0,${size}" --kind ${mode} --feature ${feature} --scenes "${scenes}" --nb_zones "${nb_zones}" --percent 1 --renderer "maxwell" --step 40 --random 1 --custom ${CUSTOM_MIN_MAX_FILENAME}
                 # python train_model.py --data ${FILENAME} --output ${MODEL_NAME} --choice ${model}