Commit 151e596e35ec84ccb1223d3009ccc017eaf9b9e2

Authored by Mathias Quillot
1 parent d8a0137010
Exists in master

Some modification we don't realy care

Showing 1 changed file with 15 additions and 15 deletions Inline Diff

1 # Pour le moment, le run ne fait qu'executer 1 # Pour le moment, le run ne fait qu'executer
2 # quelques petites commandes que l'on souhaite 2 # quelques petites commandes que l'on souhaite
3 # tester. 3 # tester.
4 4
5 OUTDIR="exp/kmeans_teacher_1/pvector-1" 5 OUTDIR="exp/kmeans_teacher_1/pvector-1"
6 DATADIR="data" 6 DATADIR="data"
7 NEW_LSTDIR="${OUTDIR}/lst" 7 NEW_LSTDIR="${OUTDIR}/lst"
8 8
9 kmin=2 9 kmin=2
10 kmax=100 10 kmax=100
11 11
12 if [ ! -d "$OUTDIR" ]; 12 if [ ! -d "$OUTDIR" ];
13 then 13 then
14 mkdir -p $OUTDIR 14 mkdir -p $OUTDIR
15 fi 15 fi
16 16
17 if [ ! -d "$NEW_LSTDIR" ]; 17 if [ ! -d "$NEW_LSTDIR" ];
18 then 18 then
19 mkdir -p $NEW_LSTDIR 19 mkdir -p $NEW_LSTDIR
20 fi 20 fi
21 21
22 for kfold in {1..4} 22 for kfold in {1..4}
23 do 23 do
24 pvector_file="${DATADIR}/pvectors_1rst/pvectors_teacher_${kfold}.txt" 24 pvector_file="${DATADIR}/pvectors_1rst/pvectors_teacher_${kfold}.txt"
25 lst_dir="${DATADIR}/pvectors_1rst/lst" 25 lst_dir="${DATADIR}/pvectors_1rst/lst"
26 output_kfold="${OUTDIR}/${kfold}" 26 output_kfold="${OUTDIR}/${kfold}"
27 27
28 #python3 "bin/replace_label.py" \ 28 #python3 "bin/replace_label.py" \
29 # "${DATADIR}/masseffect.lst" \ 29 # "${DATADIR}/masseffect.lst" \
30 # "${DATADIR}/character_information.csv" \ 30 # "${DATADIR}/character_information.csv" \
31 # --field "type" --lst "data/pvectors_1rst/lst/train_${kfold}.lst" \ 31 # --field "type" --lst "data/pvectors_1rst/lst/train_${kfold}.lst" \
32 # --outfile "${NEW_LSTDIR}/train_${kfold}_type.lst" 32 # --outfile "${NEW_LSTDIR}/train_${kfold}_type.lst"
33 33
34 #python3 "bin/replace_label.py" \ 34 #python3 "bin/replace_label.py" \
35 # "${DATADIR}/masseffect.lst" \ 35 # "${DATADIR}/masseffect.lst" \
36 # "${DATADIR}/character_information.csv" \ 36 # "${DATADIR}/character_information.csv" \
37 # --field "type" --lst "data/pvectors_1rst/lst/val_${kfold}.lst" \ 37 # --field "type" --lst "data/pvectors_1rst/lst/val_${kfold}.lst" \
38 # --outfile "${NEW_LSTDIR}/val_${kfold}_type.lst" 38 # --outfile "${NEW_LSTDIR}/val_${kfold}_type.lst"
39 39
40 cat "${NEW_LSTDIR}/train_${kfold}_type.lst" "${NEW_LSTDIR}/val_${kfold}_type.lst" > "${NEW_LSTDIR}/metas_${kfold}_type.lst" 40 #cat "${NEW_LSTDIR}/train_${kfold}_type.lst" "${NEW_LSTDIR}/val_${kfold}_type.lst" > "${NEW_LSTDIR}/metas_${kfold}_type.lst"
41 41
42 42
43 echo "Clustering - ${kfold}" 43 echo "Clustering - ${kfold}"
44 44
45 for k in $(seq ${kmin} 1 ${kmax}) 45 for k in $(seq ${kmin} 1 ${kmax})
46 do 46 do
47 echo "Kmeans Measuring and ploting - ${k}" 47 echo "Kmeans Measuring and ploting - ${k}"
48 48
49 # This script compute measures from clustering 49 # This script compute measures from clustering
50 #python3 bin/measure_clustering.py "${output_kfold}/${k}/clustered_${k}.txt" "${pvector_file}" "${lst_dir}/train_${kfold}.lst" "${lst_dir}/val_${kfold}.lst" --outfile "${output_kfold}/${k}/measures.json" 50 #python3 bin/measure_clustering.py "${output_kfold}/${k}/clustered_${k}.txt" "${pvector_file}" "${lst_dir}/train_${kfold}.lst" "${lst_dir}/val_${kfold}.lst" --outfile "${output_kfold}/${k}/measures.json"
51 51
52 python3 bin/measure_clustering.py "${output_kfold}/${k}/clustered_${k}.txt" \ 52 #python3 bin/measure_clustering.py "${output_kfold}/${k}/clustered_${k}.txt" \
53 "${NEW_LSTDIR}/metas_${kfold}_type.lst" "${lst_dir}/train_${kfold}.lst" \ 53 # "${NEW_LSTDIR}/metas_${kfold}_type.lst" "${lst_dir}/train_${kfold}.lst" \
54 "${lst_dir}/val_${kfold}.lst" \ 54 # "${lst_dir}/val_${kfold}.lst" \
55 --outfile "${output_kfold}/${k}/measures_type.json" 55 # --outfile "${output_kfold}/${k}/measures_type.json"
56 56
57 # This script plot the count matrix of the train set 57 # This script plot the count matrix of the train set
58 python3 bin/plot-count-matrix.py ${output_kfold}/${k}/clustered_${k}.txt \ 58 python3 bin/plot-count-matrix.py ${output_kfold}/${k}/clustered_${k}.txt \
59 ${NEW_LSTDIR}/metas_${kfold}_type.lst ${lst_dir}/train_${kfold}.lst \ 59 ${NEW_LSTDIR}/metas_${kfold}_type.lst ${lst_dir}/train_${kfold}.lst \
60 --outfile ${output_kfold}/${k}/train_count_matrix_type.pdf 60 --outfile ${output_kfold}/${k}/train_count_matrix_type.pdf
61 61
62 # This script plot the count matrix of the validation set 62 # This script plot the count matrix of the validation set
63 python3 bin/plot-count-matrix.py ${output_kfold}/${k}/clustered_${k}.txt \ 63 python3 bin/plot-count-matrix.py ${output_kfold}/${k}/clustered_${k}.txt \
64 ${NEW_LSTDIR}/metas_${kfold}_type.lst ${lst_dir}/val_${kfold}.lst \ 64 ${NEW_LSTDIR}/metas_${kfold}_type.lst ${lst_dir}/val_${kfold}.lst \
65 --outfile ${output_kfold}/${k}/val_count_matrix_type.pdf 65 --outfile ${output_kfold}/${k}/val_count_matrix_type.pdf
66 66
67 # This script plot the count matrix of the train set 67 # This script plot the count matrix of the train set
68 #python3 bin/plot-count-matrix.py ${output_kfold}/${k}/clustered_${k}.txt \ 68 python3 bin/plot-count-matrix.py ${output_kfold}/${k}/clustered_${k}.txt \
69 #${pvector_file} ${lst_dir}/train_${kfold}.lst \ 69 ${pvector_file} ${lst_dir}/train_${kfold}.lst \
70 #--outfile ${output_kfold}/${k}/train_count_matrix.pdf 70 --outfile ${output_kfold}/${k}/train_count_matrix.pdf
71 71
72 # This script plot the count matrix of the validation set 72 # This script plot the count matrix of the validation set
73 #python3 bin/plot-count-matrix.py ${output_kfold}/${k}/clustered_${k}.txt \ 73 python3 bin/plot-count-matrix.py ${output_kfold}/${k}/clustered_${k}.txt \
74 #${pvector_file} ${lst_dir}/val_${kfold}.lst \ 74 ${pvector_file} ${lst_dir}/val_${kfold}.lst \
75 #--outfile ${output_kfold}/${k}/val_count_matrix.pdf 75 --outfile ${output_kfold}/${k}/val_count_matrix.pdf
76 done 76 done
77 done 77 done
78 78
79 79