transformer

This commit is contained in:
em474re 2021-09-21 13:17:22 +02:00
parent 76bf877800
commit 2d1376cd6d
3 changed files with 858 additions and 0 deletions

View File

@ -0,0 +1,296 @@
filename,prediction
devel_001.wav,False
devel_002.wav,False
devel_003.wav,False
devel_004.wav,False
devel_005.wav,False
devel_006.wav,False
devel_007.wav,False
devel_008.wav,False
devel_009.wav,False
devel_010.wav,False
devel_011.wav,False
devel_012.wav,False
devel_013.wav,False
devel_014.wav,False
devel_015.wav,False
devel_016.wav,False
devel_017.wav,False
devel_018.wav,False
devel_019.wav,False
devel_020.wav,False
devel_021.wav,False
devel_022.wav,False
devel_023.wav,False
devel_024.wav,False
devel_025.wav,False
devel_026.wav,False
devel_027.wav,False
devel_028.wav,False
devel_029.wav,False
devel_030.wav,False
devel_031.wav,False
devel_032.wav,False
devel_033.wav,False
devel_034.wav,False
devel_035.wav,False
devel_036.wav,False
devel_037.wav,False
devel_038.wav,False
devel_039.wav,False
devel_040.wav,False
devel_041.wav,False
devel_042.wav,False
devel_043.wav,False
devel_044.wav,False
devel_045.wav,False
devel_046.wav,False
devel_047.wav,False
devel_048.wav,False
devel_049.wav,False
devel_050.wav,False
devel_051.wav,False
devel_052.wav,False
devel_053.wav,False
devel_054.wav,False
devel_055.wav,False
devel_056.wav,False
devel_057.wav,False
devel_058.wav,False
devel_059.wav,False
devel_060.wav,False
devel_061.wav,False
devel_062.wav,False
devel_063.wav,False
devel_064.wav,False
devel_065.wav,False
devel_066.wav,False
devel_067.wav,False
devel_068.wav,False
devel_069.wav,False
devel_070.wav,False
devel_071.wav,False
devel_072.wav,False
devel_073.wav,False
devel_074.wav,False
devel_075.wav,False
devel_076.wav,False
devel_077.wav,False
devel_078.wav,False
devel_079.wav,False
devel_080.wav,False
devel_081.wav,False
devel_082.wav,False
devel_083.wav,False
devel_084.wav,False
devel_085.wav,False
devel_086.wav,False
devel_087.wav,False
devel_088.wav,False
devel_089.wav,False
devel_090.wav,False
devel_091.wav,False
devel_092.wav,False
devel_093.wav,False
devel_094.wav,False
devel_095.wav,False
devel_096.wav,False
devel_097.wav,False
devel_098.wav,False
devel_099.wav,False
devel_100.wav,False
devel_101.wav,False
devel_102.wav,False
devel_103.wav,False
devel_104.wav,False
devel_105.wav,False
devel_106.wav,False
devel_107.wav,False
devel_108.wav,False
devel_109.wav,False
devel_110.wav,False
devel_111.wav,False
devel_112.wav,False
devel_113.wav,False
devel_114.wav,False
devel_115.wav,False
devel_116.wav,False
devel_117.wav,False
devel_118.wav,False
devel_119.wav,False
devel_120.wav,False
devel_121.wav,False
devel_122.wav,False
devel_123.wav,False
devel_124.wav,False
devel_125.wav,False
devel_126.wav,False
devel_127.wav,False
devel_128.wav,False
devel_129.wav,False
devel_130.wav,False
devel_131.wav,False
devel_132.wav,False
devel_133.wav,False
devel_134.wav,False
devel_135.wav,False
devel_136.wav,False
devel_137.wav,False
devel_138.wav,False
devel_139.wav,False
devel_140.wav,False
devel_141.wav,False
devel_142.wav,False
devel_143.wav,False
devel_144.wav,False
devel_145.wav,False
devel_146.wav,False
devel_147.wav,False
devel_148.wav,False
devel_149.wav,False
devel_150.wav,False
devel_151.wav,False
devel_152.wav,False
devel_153.wav,False
devel_154.wav,False
devel_155.wav,False
devel_156.wav,False
devel_157.wav,False
devel_158.wav,False
devel_159.wav,False
devel_160.wav,False
devel_161.wav,False
devel_162.wav,False
devel_163.wav,False
devel_164.wav,False
devel_165.wav,False
devel_166.wav,False
devel_167.wav,False
devel_168.wav,False
devel_169.wav,False
devel_170.wav,False
devel_171.wav,False
devel_172.wav,False
devel_173.wav,False
devel_174.wav,False
devel_175.wav,False
devel_176.wav,False
devel_177.wav,False
devel_178.wav,False
devel_179.wav,False
devel_180.wav,False
devel_181.wav,False
devel_182.wav,False
devel_183.wav,False
devel_184.wav,False
devel_185.wav,False
devel_186.wav,False
devel_187.wav,False
devel_188.wav,False
devel_189.wav,False
devel_190.wav,False
devel_191.wav,False
devel_192.wav,False
devel_193.wav,False
devel_194.wav,False
devel_195.wav,False
devel_196.wav,False
devel_197.wav,False
devel_198.wav,False
devel_199.wav,False
devel_200.wav,False
devel_201.wav,False
devel_202.wav,False
devel_203.wav,False
devel_204.wav,False
devel_205.wav,False
devel_206.wav,False
devel_207.wav,False
devel_208.wav,False
devel_209.wav,False
devel_210.wav,False
devel_211.wav,False
devel_212.wav,False
devel_213.wav,False
devel_214.wav,False
devel_215.wav,False
devel_216.wav,False
devel_217.wav,False
devel_218.wav,False
devel_219.wav,False
devel_220.wav,False
devel_221.wav,False
devel_222.wav,False
devel_223.wav,False
devel_224.wav,False
devel_225.wav,False
devel_226.wav,False
devel_227.wav,False
devel_228.wav,False
devel_229.wav,False
devel_230.wav,False
devel_231.wav,False
devel_232.wav,False
devel_233.wav,False
devel_234.wav,False
devel_235.wav,False
devel_236.wav,False
devel_237.wav,False
devel_238.wav,False
devel_239.wav,False
devel_240.wav,False
devel_241.wav,False
devel_242.wav,False
devel_243.wav,False
devel_244.wav,False
devel_245.wav,False
devel_246.wav,False
devel_247.wav,False
devel_248.wav,False
devel_249.wav,False
devel_250.wav,False
devel_251.wav,False
devel_252.wav,False
devel_253.wav,False
devel_254.wav,False
devel_255.wav,False
devel_256.wav,False
devel_257.wav,False
devel_258.wav,False
devel_259.wav,False
devel_260.wav,False
devel_261.wav,False
devel_262.wav,False
devel_263.wav,False
devel_264.wav,False
devel_265.wav,False
devel_266.wav,False
devel_267.wav,False
devel_268.wav,False
devel_269.wav,False
devel_270.wav,False
devel_271.wav,False
devel_272.wav,False
devel_273.wav,False
devel_274.wav,False
devel_275.wav,False
devel_276.wav,False
devel_277.wav,False
devel_278.wav,False
devel_279.wav,False
devel_280.wav,False
devel_281.wav,False
devel_282.wav,False
devel_283.wav,False
devel_284.wav,False
devel_285.wav,False
devel_286.wav,False
devel_287.wav,False
devel_288.wav,False
devel_289.wav,False
devel_290.wav,False
devel_291.wav,False
devel_292.wav,False
devel_293.wav,False
devel_294.wav,False
devel_295.wav,False
1 filename prediction
2 devel_001.wav False
3 devel_002.wav False
4 devel_003.wav False
5 devel_004.wav False
6 devel_005.wav False
7 devel_006.wav False
8 devel_007.wav False
9 devel_008.wav False
10 devel_009.wav False
11 devel_010.wav False
12 devel_011.wav False
13 devel_012.wav False
14 devel_013.wav False
15 devel_014.wav False
16 devel_015.wav False
17 devel_016.wav False
18 devel_017.wav False
19 devel_018.wav False
20 devel_019.wav False
21 devel_020.wav False
22 devel_021.wav False
23 devel_022.wav False
24 devel_023.wav False
25 devel_024.wav False
26 devel_025.wav False
27 devel_026.wav False
28 devel_027.wav False
29 devel_028.wav False
30 devel_029.wav False
31 devel_030.wav False
32 devel_031.wav False
33 devel_032.wav False
34 devel_033.wav False
35 devel_034.wav False
36 devel_035.wav False
37 devel_036.wav False
38 devel_037.wav False
39 devel_038.wav False
40 devel_039.wav False
41 devel_040.wav False
42 devel_041.wav False
43 devel_042.wav False
44 devel_043.wav False
45 devel_044.wav False
46 devel_045.wav False
47 devel_046.wav False
48 devel_047.wav False
49 devel_048.wav False
50 devel_049.wav False
51 devel_050.wav False
52 devel_051.wav False
53 devel_052.wav False
54 devel_053.wav False
55 devel_054.wav False
56 devel_055.wav False
57 devel_056.wav False
58 devel_057.wav False
59 devel_058.wav False
60 devel_059.wav False
61 devel_060.wav False
62 devel_061.wav False
63 devel_062.wav False
64 devel_063.wav False
65 devel_064.wav False
66 devel_065.wav False
67 devel_066.wav False
68 devel_067.wav False
69 devel_068.wav False
70 devel_069.wav False
71 devel_070.wav False
72 devel_071.wav False
73 devel_072.wav False
74 devel_073.wav False
75 devel_074.wav False
76 devel_075.wav False
77 devel_076.wav False
78 devel_077.wav False
79 devel_078.wav False
80 devel_079.wav False
81 devel_080.wav False
82 devel_081.wav False
83 devel_082.wav False
84 devel_083.wav False
85 devel_084.wav False
86 devel_085.wav False
87 devel_086.wav False
88 devel_087.wav False
89 devel_088.wav False
90 devel_089.wav False
91 devel_090.wav False
92 devel_091.wav False
93 devel_092.wav False
94 devel_093.wav False
95 devel_094.wav False
96 devel_095.wav False
97 devel_096.wav False
98 devel_097.wav False
99 devel_098.wav False
100 devel_099.wav False
101 devel_100.wav False
102 devel_101.wav False
103 devel_102.wav False
104 devel_103.wav False
105 devel_104.wav False
106 devel_105.wav False
107 devel_106.wav False
108 devel_107.wav False
109 devel_108.wav False
110 devel_109.wav False
111 devel_110.wav False
112 devel_111.wav False
113 devel_112.wav False
114 devel_113.wav False
115 devel_114.wav False
116 devel_115.wav False
117 devel_116.wav False
118 devel_117.wav False
119 devel_118.wav False
120 devel_119.wav False
121 devel_120.wav False
122 devel_121.wav False
123 devel_122.wav False
124 devel_123.wav False
125 devel_124.wav False
126 devel_125.wav False
127 devel_126.wav False
128 devel_127.wav False
129 devel_128.wav False
130 devel_129.wav False
131 devel_130.wav False
132 devel_131.wav False
133 devel_132.wav False
134 devel_133.wav False
135 devel_134.wav False
136 devel_135.wav False
137 devel_136.wav False
138 devel_137.wav False
139 devel_138.wav False
140 devel_139.wav False
141 devel_140.wav False
142 devel_141.wav False
143 devel_142.wav False
144 devel_143.wav False
145 devel_144.wav False
146 devel_145.wav False
147 devel_146.wav False
148 devel_147.wav False
149 devel_148.wav False
150 devel_149.wav False
151 devel_150.wav False
152 devel_151.wav False
153 devel_152.wav False
154 devel_153.wav False
155 devel_154.wav False
156 devel_155.wav False
157 devel_156.wav False
158 devel_157.wav False
159 devel_158.wav False
160 devel_159.wav False
161 devel_160.wav False
162 devel_161.wav False
163 devel_162.wav False
164 devel_163.wav False
165 devel_164.wav False
166 devel_165.wav False
167 devel_166.wav False
168 devel_167.wav False
169 devel_168.wav False
170 devel_169.wav False
171 devel_170.wav False
172 devel_171.wav False
173 devel_172.wav False
174 devel_173.wav False
175 devel_174.wav False
176 devel_175.wav False
177 devel_176.wav False
178 devel_177.wav False
179 devel_178.wav False
180 devel_179.wav False
181 devel_180.wav False
182 devel_181.wav False
183 devel_182.wav False
184 devel_183.wav False
185 devel_184.wav False
186 devel_185.wav False
187 devel_186.wav False
188 devel_187.wav False
189 devel_188.wav False
190 devel_189.wav False
191 devel_190.wav False
192 devel_191.wav False
193 devel_192.wav False
194 devel_193.wav False
195 devel_194.wav False
196 devel_195.wav False
197 devel_196.wav False
198 devel_197.wav False
199 devel_198.wav False
200 devel_199.wav False
201 devel_200.wav False
202 devel_201.wav False
203 devel_202.wav False
204 devel_203.wav False
205 devel_204.wav False
206 devel_205.wav False
207 devel_206.wav False
208 devel_207.wav False
209 devel_208.wav False
210 devel_209.wav False
211 devel_210.wav False
212 devel_211.wav False
213 devel_212.wav False
214 devel_213.wav False
215 devel_214.wav False
216 devel_215.wav False
217 devel_216.wav False
218 devel_217.wav False
219 devel_218.wav False
220 devel_219.wav False
221 devel_220.wav False
222 devel_221.wav False
223 devel_222.wav False
224 devel_223.wav False
225 devel_224.wav False
226 devel_225.wav False
227 devel_226.wav False
228 devel_227.wav False
229 devel_228.wav False
230 devel_229.wav False
231 devel_230.wav False
232 devel_231.wav False
233 devel_232.wav False
234 devel_233.wav False
235 devel_234.wav False
236 devel_235.wav False
237 devel_236.wav False
238 devel_237.wav False
239 devel_238.wav False
240 devel_239.wav False
241 devel_240.wav False
242 devel_241.wav False
243 devel_242.wav False
244 devel_243.wav False
245 devel_244.wav False
246 devel_245.wav False
247 devel_246.wav False
248 devel_247.wav False
249 devel_248.wav False
250 devel_249.wav False
251 devel_250.wav False
252 devel_251.wav False
253 devel_252.wav False
254 devel_253.wav False
255 devel_254.wav False
256 devel_255.wav False
257 devel_256.wav False
258 devel_257.wav False
259 devel_258.wav False
260 devel_259.wav False
261 devel_260.wav False
262 devel_261.wav False
263 devel_262.wav False
264 devel_263.wav False
265 devel_264.wav False
266 devel_265.wav False
267 devel_266.wav False
268 devel_267.wav False
269 devel_268.wav False
270 devel_269.wav False
271 devel_270.wav False
272 devel_271.wav False
273 devel_272.wav False
274 devel_273.wav False
275 devel_274.wav False
276 devel_275.wav False
277 devel_276.wav False
278 devel_277.wav False
279 devel_278.wav False
280 devel_279.wav False
281 devel_280.wav False
282 devel_281.wav False
283 devel_282.wav False
284 devel_283.wav False
285 devel_284.wav False
286 devel_285.wav False
287 devel_286.wav False
288 devel_287.wav False
289 devel_288.wav False
290 devel_289.wav False
291 devel_290.wav False
292 devel_291.wav False
293 devel_292.wav False
294 devel_293.wav False
295 devel_294.wav False
296 devel_295.wav False

View File

@ -0,0 +1,284 @@
filename,prediction
test_001.wav,False
test_002.wav,False
test_003.wav,False
test_004.wav,False
test_005.wav,False
test_006.wav,False
test_007.wav,False
test_008.wav,False
test_009.wav,False
test_010.wav,False
test_011.wav,False
test_012.wav,False
test_013.wav,False
test_014.wav,False
test_015.wav,False
test_016.wav,False
test_017.wav,False
test_018.wav,False
test_019.wav,False
test_020.wav,False
test_021.wav,False
test_022.wav,False
test_023.wav,False
test_024.wav,False
test_025.wav,False
test_026.wav,False
test_027.wav,False
test_028.wav,False
test_029.wav,False
test_030.wav,False
test_031.wav,False
test_032.wav,False
test_033.wav,False
test_034.wav,False
test_035.wav,False
test_036.wav,False
test_037.wav,False
test_038.wav,False
test_039.wav,False
test_040.wav,False
test_041.wav,False
test_042.wav,False
test_043.wav,False
test_044.wav,False
test_045.wav,False
test_046.wav,False
test_047.wav,False
test_048.wav,False
test_049.wav,False
test_050.wav,False
test_051.wav,False
test_052.wav,False
test_053.wav,False
test_054.wav,False
test_055.wav,False
test_056.wav,False
test_057.wav,False
test_058.wav,False
test_059.wav,False
test_060.wav,False
test_061.wav,False
test_062.wav,False
test_063.wav,False
test_064.wav,False
test_065.wav,False
test_066.wav,False
test_067.wav,False
test_068.wav,False
test_069.wav,False
test_070.wav,False
test_071.wav,False
test_072.wav,False
test_073.wav,False
test_074.wav,False
test_075.wav,False
test_076.wav,False
test_077.wav,False
test_078.wav,False
test_079.wav,False
test_080.wav,False
test_081.wav,False
test_082.wav,False
test_083.wav,False
test_084.wav,False
test_085.wav,False
test_086.wav,False
test_087.wav,False
test_088.wav,False
test_089.wav,False
test_090.wav,False
test_091.wav,False
test_092.wav,False
test_093.wav,False
test_094.wav,False
test_095.wav,False
test_096.wav,False
test_097.wav,False
test_098.wav,False
test_099.wav,False
test_100.wav,False
test_101.wav,False
test_102.wav,False
test_103.wav,False
test_104.wav,False
test_105.wav,False
test_106.wav,False
test_107.wav,False
test_108.wav,False
test_109.wav,False
test_110.wav,False
test_111.wav,False
test_112.wav,False
test_113.wav,False
test_114.wav,False
test_115.wav,False
test_116.wav,False
test_117.wav,False
test_118.wav,False
test_119.wav,False
test_120.wav,False
test_121.wav,False
test_122.wav,False
test_123.wav,False
test_124.wav,False
test_125.wav,False
test_126.wav,False
test_127.wav,False
test_128.wav,False
test_129.wav,False
test_130.wav,False
test_131.wav,False
test_132.wav,False
test_133.wav,False
test_134.wav,False
test_135.wav,False
test_136.wav,False
test_137.wav,False
test_138.wav,False
test_139.wav,False
test_140.wav,False
test_141.wav,False
test_142.wav,False
test_143.wav,False
test_144.wav,False
test_145.wav,False
test_146.wav,False
test_147.wav,False
test_148.wav,False
test_149.wav,False
test_150.wav,False
test_151.wav,False
test_152.wav,False
test_153.wav,False
test_154.wav,False
test_155.wav,False
test_156.wav,False
test_157.wav,False
test_158.wav,False
test_159.wav,False
test_160.wav,False
test_161.wav,False
test_162.wav,False
test_163.wav,False
test_164.wav,False
test_165.wav,False
test_166.wav,False
test_167.wav,False
test_168.wav,False
test_169.wav,False
test_170.wav,False
test_171.wav,False
test_172.wav,False
test_173.wav,False
test_174.wav,False
test_175.wav,False
test_176.wav,False
test_177.wav,False
test_178.wav,False
test_179.wav,False
test_180.wav,False
test_181.wav,False
test_182.wav,False
test_183.wav,False
test_184.wav,False
test_185.wav,False
test_186.wav,False
test_187.wav,False
test_188.wav,False
test_189.wav,False
test_190.wav,False
test_191.wav,False
test_192.wav,False
test_193.wav,False
test_194.wav,False
test_195.wav,False
test_196.wav,False
test_197.wav,False
test_198.wav,False
test_199.wav,False
test_200.wav,False
test_201.wav,False
test_202.wav,False
test_203.wav,False
test_204.wav,False
test_205.wav,False
test_206.wav,False
test_207.wav,False
test_208.wav,False
test_209.wav,False
test_210.wav,False
test_211.wav,False
test_212.wav,False
test_213.wav,False
test_214.wav,False
test_215.wav,False
test_216.wav,False
test_217.wav,False
test_218.wav,False
test_219.wav,False
test_220.wav,False
test_221.wav,False
test_222.wav,False
test_223.wav,False
test_224.wav,False
test_225.wav,False
test_226.wav,False
test_227.wav,False
test_228.wav,False
test_229.wav,False
test_230.wav,False
test_231.wav,False
test_232.wav,False
test_233.wav,False
test_234.wav,False
test_235.wav,False
test_236.wav,False
test_237.wav,False
test_238.wav,False
test_239.wav,False
test_240.wav,False
test_241.wav,False
test_242.wav,False
test_243.wav,False
test_244.wav,False
test_245.wav,False
test_246.wav,False
test_247.wav,False
test_248.wav,False
test_249.wav,False
test_250.wav,False
test_251.wav,False
test_252.wav,False
test_253.wav,False
test_254.wav,False
test_255.wav,False
test_256.wav,False
test_257.wav,False
test_258.wav,False
test_259.wav,False
test_260.wav,False
test_261.wav,False
test_262.wav,False
test_263.wav,False
test_264.wav,False
test_265.wav,False
test_266.wav,False
test_267.wav,False
test_268.wav,False
test_269.wav,False
test_270.wav,False
test_271.wav,False
test_272.wav,False
test_273.wav,False
test_274.wav,False
test_275.wav,False
test_276.wav,False
test_277.wav,False
test_278.wav,False
test_279.wav,False
test_280.wav,False
test_281.wav,False
test_282.wav,False
test_283.wav,False
1 filename prediction
2 test_001.wav False
3 test_002.wav False
4 test_003.wav False
5 test_004.wav False
6 test_005.wav False
7 test_006.wav False
8 test_007.wav False
9 test_008.wav False
10 test_009.wav False
11 test_010.wav False
12 test_011.wav False
13 test_012.wav False
14 test_013.wav False
15 test_014.wav False
16 test_015.wav False
17 test_016.wav False
18 test_017.wav False
19 test_018.wav False
20 test_019.wav False
21 test_020.wav False
22 test_021.wav False
23 test_022.wav False
24 test_023.wav False
25 test_024.wav False
26 test_025.wav False
27 test_026.wav False
28 test_027.wav False
29 test_028.wav False
30 test_029.wav False
31 test_030.wav False
32 test_031.wav False
33 test_032.wav False
34 test_033.wav False
35 test_034.wav False
36 test_035.wav False
37 test_036.wav False
38 test_037.wav False
39 test_038.wav False
40 test_039.wav False
41 test_040.wav False
42 test_041.wav False
43 test_042.wav False
44 test_043.wav False
45 test_044.wav False
46 test_045.wav False
47 test_046.wav False
48 test_047.wav False
49 test_048.wav False
50 test_049.wav False
51 test_050.wav False
52 test_051.wav False
53 test_052.wav False
54 test_053.wav False
55 test_054.wav False
56 test_055.wav False
57 test_056.wav False
58 test_057.wav False
59 test_058.wav False
60 test_059.wav False
61 test_060.wav False
62 test_061.wav False
63 test_062.wav False
64 test_063.wav False
65 test_064.wav False
66 test_065.wav False
67 test_066.wav False
68 test_067.wav False
69 test_068.wav False
70 test_069.wav False
71 test_070.wav False
72 test_071.wav False
73 test_072.wav False
74 test_073.wav False
75 test_074.wav False
76 test_075.wav False
77 test_076.wav False
78 test_077.wav False
79 test_078.wav False
80 test_079.wav False
81 test_080.wav False
82 test_081.wav False
83 test_082.wav False
84 test_083.wav False
85 test_084.wav False
86 test_085.wav False
87 test_086.wav False
88 test_087.wav False
89 test_088.wav False
90 test_089.wav False
91 test_090.wav False
92 test_091.wav False
93 test_092.wav False
94 test_093.wav False
95 test_094.wav False
96 test_095.wav False
97 test_096.wav False
98 test_097.wav False
99 test_098.wav False
100 test_099.wav False
101 test_100.wav False
102 test_101.wav False
103 test_102.wav False
104 test_103.wav False
105 test_104.wav False
106 test_105.wav False
107 test_106.wav False
108 test_107.wav False
109 test_108.wav False
110 test_109.wav False
111 test_110.wav False
112 test_111.wav False
113 test_112.wav False
114 test_113.wav False
115 test_114.wav False
116 test_115.wav False
117 test_116.wav False
118 test_117.wav False
119 test_118.wav False
120 test_119.wav False
121 test_120.wav False
122 test_121.wav False
123 test_122.wav False
124 test_123.wav False
125 test_124.wav False
126 test_125.wav False
127 test_126.wav False
128 test_127.wav False
129 test_128.wav False
130 test_129.wav False
131 test_130.wav False
132 test_131.wav False
133 test_132.wav False
134 test_133.wav False
135 test_134.wav False
136 test_135.wav False
137 test_136.wav False
138 test_137.wav False
139 test_138.wav False
140 test_139.wav False
141 test_140.wav False
142 test_141.wav False
143 test_142.wav False
144 test_143.wav False
145 test_144.wav False
146 test_145.wav False
147 test_146.wav False
148 test_147.wav False
149 test_148.wav False
150 test_149.wav False
151 test_150.wav False
152 test_151.wav False
153 test_152.wav False
154 test_153.wav False
155 test_154.wav False
156 test_155.wav False
157 test_156.wav False
158 test_157.wav False
159 test_158.wav False
160 test_159.wav False
161 test_160.wav False
162 test_161.wav False
163 test_162.wav False
164 test_163.wav False
165 test_164.wav False
166 test_165.wav False
167 test_166.wav False
168 test_167.wav False
169 test_168.wav False
170 test_169.wav False
171 test_170.wav False
172 test_171.wav False
173 test_172.wav False
174 test_173.wav False
175 test_174.wav False
176 test_175.wav False
177 test_176.wav False
178 test_177.wav False
179 test_178.wav False
180 test_179.wav False
181 test_180.wav False
182 test_181.wav False
183 test_182.wav False
184 test_183.wav False
185 test_184.wav False
186 test_185.wav False
187 test_186.wav False
188 test_187.wav False
189 test_188.wav False
190 test_189.wav False
191 test_190.wav False
192 test_191.wav False
193 test_192.wav False
194 test_193.wav False
195 test_194.wav False
196 test_195.wav False
197 test_196.wav False
198 test_197.wav False
199 test_198.wav False
200 test_199.wav False
201 test_200.wav False
202 test_201.wav False
203 test_202.wav False
204 test_203.wav False
205 test_204.wav False
206 test_205.wav False
207 test_206.wav False
208 test_207.wav False
209 test_208.wav False
210 test_209.wav False
211 test_210.wav False
212 test_211.wav False
213 test_212.wav False
214 test_213.wav False
215 test_214.wav False
216 test_215.wav False
217 test_216.wav False
218 test_217.wav False
219 test_218.wav False
220 test_219.wav False
221 test_220.wav False
222 test_221.wav False
223 test_222.wav False
224 test_223.wav False
225 test_224.wav False
226 test_225.wav False
227 test_226.wav False
228 test_227.wav False
229 test_228.wav False
230 test_229.wav False
231 test_230.wav False
232 test_231.wav False
233 test_232.wav False
234 test_233.wav False
235 test_234.wav False
236 test_235.wav False
237 test_236.wav False
238 test_237.wav False
239 test_238.wav False
240 test_239.wav False
241 test_240.wav False
242 test_241.wav False
243 test_242.wav False
244 test_243.wav False
245 test_244.wav False
246 test_245.wav False
247 test_246.wav False
248 test_247.wav False
249 test_248.wav False
250 test_249.wav False
251 test_250.wav False
252 test_251.wav False
253 test_252.wav False
254 test_253.wav False
255 test_254.wav False
256 test_255.wav False
257 test_256.wav False
258 test_257.wav False
259 test_258.wav False
260 test_259.wav False
261 test_260.wav False
262 test_261.wav False
263 test_262.wav False
264 test_263.wav False
265 test_264.wav False
266 test_265.wav False
267 test_266.wav False
268 test_267.wav False
269 test_268.wav False
270 test_269.wav False
271 test_270.wav False
272 test_271.wav False
273 test_272.wav False
274 test_273.wav False
275 test_274.wav False
276 test_275.wav False
277 test_276.wav False
278 test_277.wav False
279 test_278.wav False
280 test_279.wav False
281 test_280.wav False
282 test_281.wav False
283 test_282.wav False
284 test_283.wav False

278
src/transformer_hand_vgg.py Normal file
View File

@ -0,0 +1,278 @@
import numpy as np
from keras import backend as K
from sklearn.metrics import classification_report, confusion_matrix, recall_score, make_scorer, plot_confusion_matrix
import tensorflow as tf
import pandas as pd
import matplotlib.pyplot as plt
import os
def non_nan_average(x):
# Computes the average of all elements that are not NaN in a rank 1 tensor
nan_mask = tf.math.is_nan(x)
x = tf.boolean_mask(x, tf.logical_not(nan_mask))
return K.mean(x)
def uar_accuracy(y_true, y_pred):
# Calculate the label from one-hot encoding
pred_class_label = K.argmax(y_pred, axis=-1)
true_class_label = K.argmax(y_true, axis=-1)
cf_mat = tf.math.confusion_matrix(true_class_label, pred_class_label )
diag = tf.linalg.tensor_diag_part(cf_mat)
# Calculate the total number of data examples for each class
total_per_class = tf.reduce_sum(cf_mat, axis=1)
acc_per_class = diag / tf.maximum(1, total_per_class)
uar = non_nan_average(acc_per_class)
return uar
# load features and labels
devel_X_vgg = np.load(
"./features/vgg_features/x_devel_data_vgg.npy", allow_pickle=True
)
test_X_vgg = np.load(
"./features/vgg_features/x_test_data_vgg.npy", allow_pickle=True
)
train_X_vgg = np.load(
"./features/vgg_features/x_train_data_vgg.npy", allow_pickle=True
)
devel_X_hand = np.load(
"./features/hand_features/x_devel_data.npy", allow_pickle=True
)
test_X_hand = np.load(
"./features/hand_features/x_test_data.npy", allow_pickle=True
)
train_X_hand = np.load(
"./features/hand_features/x_train_data.npy", allow_pickle=True
)
devel_y = np.load(
"./features/vgg_features/y_devel_label_vgg.npy", allow_pickle=True
)
test_y = np.load(
"./features/vgg_features/y_test_label_vgg.npy", allow_pickle=True
)
train_y = np.load(
"./features/vgg_features/y_train_label_vgg.npy", allow_pickle=True
)
devel_names = np.load(
"./features/hand_features/devel_names.npy", allow_pickle=True
)
test_names = np.load(
"./features/hand_features/test_names.npy", allow_pickle=True
)
train_X_vgg = np.squeeze(train_X_vgg)
devel_X_vgg = np.squeeze(devel_X_vgg)
test_X_vgg = np.squeeze(test_X_vgg)
devel_X=np.concatenate(
(
devel_X_hand,
devel_X_vgg
),
axis=1,
)
test_X=np.concatenate(
(
test_X_hand,
test_X_vgg
),
axis=1,
)
train_X=np.concatenate(
(
train_X_hand,
train_X_vgg
),
axis=1,
)
X = np.append(train_X, devel_X, axis=0)
y = np.append(train_y, devel_y, axis=0)
x = X.reshape((X.shape[0], X.shape[1], 1))
x_train = train_X.reshape((train_X.shape[0], train_X.shape[1], 1))
x_test = test_X.reshape((test_X.shape[0], test_X.shape[1], 1))
devel_X = devel_X.reshape((devel_X.shape[0], devel_X.shape[1], 1))
n_classes = len(np.unique(y))
train_y[train_y == "positive"] = 1
train_y[train_y == "negative"] = 0
y[y == "positive"] = 1
y[y == "negative"] = 0
devel_y[devel_y == "positive"] = 1
devel_y[devel_y == "negative"] = 0
test_y[test_y == "positive"] = 1
test_y[test_y == "negative"] = 0
"""
## Build the model
Our model processes a tensor of shape `(batch size, sequence length, features)`,
where `sequence length` is the number of time steps and `features` is each input
timeseries.
You can replace your classification RNN layers with this one: the
inputs are fully compatible!
"""
from tensorflow import keras
from tensorflow.keras import layers
"""
We include residual connections, layer normalization, and dropout.
The resulting layer can be stacked multiple times.
The projection layers are implemented through `keras.layers.Conv1D`.
"""
def transformer_encoder(inputs, head_size, num_heads, ff_dim, dropout=0):
# Attention and Normalization
x = layers.MultiHeadAttention(
key_dim=head_size, num_heads=num_heads, dropout=dropout
)(inputs, inputs)
x = layers.Dropout(dropout)(x)
x = layers.LayerNormalization(epsilon=1e-6)(x)
res = x + inputs
# Feed Forward Part
x = layers.Conv1D(filters=ff_dim, kernel_size=1, activation="relu")(res)
x = layers.Dropout(dropout)(x)
x = layers.Conv1D(filters=inputs.shape[-1], kernel_size=1)(x)
x = layers.LayerNormalization(epsilon=1e-6)(x)
return x + res
"""
The main part of our model is now complete. We can stack multiple of those
`transformer_encoder` blocks and we can also proceed to add the final
Multi-Layer Perceptron classification head. Apart from a stack of `Dense`
layers, we need to reduce the output tensor of the `TransformerEncoder` part of
our model down to a vector of features for each data point in the current
batch. A common way to achieve this is to use a pooling layer. For
this example, a `GlobalAveragePooling1D` layer is sufficient.
"""
def build_model(
input_shape,
head_size,
num_heads,
ff_dim,
num_transformer_blocks,
mlp_units,
dropout=0,
mlp_dropout=0,
):
inputs = keras.Input(shape=input_shape)
x = inputs
for _ in range(num_transformer_blocks):
x = transformer_encoder(x, head_size, num_heads, ff_dim, dropout)
x = layers.GlobalAveragePooling1D(data_format="channels_first")(x)
for dim in mlp_units:
x = layers.Dense(dim, activation="relu")(x)
x = layers.Dropout(mlp_dropout)(x)
outputs = layers.Dense(1, activation="sigmoid")(x)
return keras.Model(inputs, outputs)
"""
## Train and evaluate
"""
input_shape = x_train.shape[1:]
model = build_model(
input_shape,
head_size=256,
num_heads=4,
ff_dim=4,
num_transformer_blocks=4,
mlp_units=[128],
mlp_dropout=0.4,
dropout=0.25,
)
model.compile(
loss="binary_crossentropy",
optimizer=keras.optimizers.Adam(learning_rate=1e-4),
metrics=[uar_accuracy],
)
model.summary()
callbacks = [keras.callbacks.EarlyStopping(patience=10, restore_best_weights=True)]
model.fit(
np.asarray(x_train).astype(np.float32),
np.asarray(train_y).astype(np.float32),
validation_split=0.2,
epochs=20,
batch_size=64,
callbacks=callbacks,
)
devel_y_pred = model.predict(np.asarray(devel_X).astype(np.float32), verbose=1)
devel_y_pred = devel_y_pred.argmax(axis=-1)
devel_y_pred = devel_y_pred.astype('bool')
devel_y = devel_y.astype('bool')
# devel metrics
print('DEVEL')
uar = recall_score(devel_y, devel_y_pred, average='macro')
cm = confusion_matrix(devel_y, devel_y_pred)
print(f'UAR: {uar}\n{classification_report(devel_y, devel_y_pred)}\n\nConfusion Matrix:\n\n{cm}')
model.fit(
np.asarray(x).astype(np.float32),
np.asarray(y).astype(np.float32),
validation_split=0.2,
epochs=20,
batch_size=64,
callbacks=callbacks,
)
test_y_pred = model.predict(np.asarray(x_test).astype(np.float32), verbose=1)
test_y_pred = test_y_pred.argmax(axis=-1)
test_y_pred = test_y_pred.astype('bool')
test_y = test_y.astype('bool')
# devel metrics
print('DEVEL')
uar = recall_score(devel_y, devel_y_pred, average='macro')
cm = confusion_matrix(devel_y, devel_y_pred)
print(f'UAR: {uar}\n{classification_report(devel_y, devel_y_pred)}\n\nConfusion Matrix:\n\n{cm}')
df_predictions = pd.DataFrame({'filename': devel_names.tolist(), 'prediction': devel_y_pred.tolist()})
df_predictions.to_csv(os.path.join('./results/trans_hand_vgg/', 'devel.predictions.csv'), index=False)
# test metrics
print('TEST')
uar = recall_score(test_y, test_y_pred, average='macro')
cm = confusion_matrix(test_y, test_y_pred)
print(f'UAR: {uar}\n{classification_report(test_y, test_y_pred)}\n\nConfusion Matrix:\n\n{cm}')
df_predictions = pd.DataFrame({'filename': test_names.tolist(), 'prediction': test_y_pred.tolist()})
df_predictions.to_csv(os.path.join('./results/trans_hand_vgg/', 'test.predictions.csv'), index=False)