blob: 41acb5fb83e985bdf9e5cedd18d8677c7a6415e4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
|
#N canvas 57 0 663 539 10;
#X obj 396 55 grid grid1 200 -1 1 200 -1 1 1 0.001 0.001 2 2 450 248
;
#X floatatom 396 261 5 0 0 0 - - -;
#X floatatom 589 262 5 0 0 0 - - -;
#X obj 397 278 pack f f;
#X obj 81 136 h_vector sample_pool;
#X msg 183 119 print;
#N canvas 143 0 450 300 pushback 0;
#X obj 22 21 inlet;
#X msg 22 120 pushback;
#X obj 22 195 outlet;
#X obj 22 156 iem_append;
#X obj 22 76 t b a;
#X connect 0 0 4 0;
#X connect 1 0 3 0;
#X connect 3 0 2 0;
#X connect 4 0 1 0;
#X connect 4 1 3 1;
#X restore 81 97 pd pushback;
#X msg 183 98 clear;
#X text 37 27 add new datasets to the vector:;
#N canvas 504 132 747 729 train_net_on_datasets 0;
#X obj 116 562 gen_trainfile;
#X text 91 404 2) step through all;
#X text 85 108 1) create net;
#X text 106 151 a) get nr. of inputs:;
#X obj 122 205 h_vector sample_pool;
#X msg 122 183 get 0;
#X obj 122 227 length;
#X obj 122 249 - 1;
#X text 297 151 b) get nr. of outputs:;
#X obj 314 199 h_vector sample_pool;
#X msg 314 178 getsize;
#X obj 122 129 t b b;
#X obj 122 288 pack 0 0 0;
#X obj 122 345 s \$0-to_net;
#X obj 46 41 inlet;
#X obj 159 488 pack 0 0 0 0;
#X msg 159 536 \$2 \$3 \$4;
#N canvas 754 184 450 454 step_through_datas 0;
#X obj 21 20 inlet;
#X obj 79 423 outlet;
#X obj 130 99 h_vector sample_pool;
#X msg 130 79 getsize;
#X obj 21 138 h_for;
#X obj 21 213 h_vector sample_pool;
#X msg 21 191 get \$1;
#X obj 21 257 niagara 1;
#X text 62 278 input;
#X obj 21 48 t b b;
#X obj 21 164 t f f;
#X obj 203 257 h_muxlist;
#X text 183 279 output;
#X obj 79 353 glue;
#X connect 0 0 9 0;
#X connect 2 1 4 1;
#X connect 2 1 11 1;
#X connect 3 0 2 0;
#X connect 4 0 10 0;
#X connect 5 0 7 0;
#X connect 6 0 5 0;
#X connect 7 1 13 0;
#X connect 9 0 4 0;
#X connect 9 1 3 0;
#X connect 10 0 6 0;
#X connect 10 1 11 0;
#X connect 11 0 13 1;
#X connect 13 0 1 0;
#X restore 116 458 pd step_through_datas;
#X obj 116 429 t b b b;
#X text 65 601 3) train the net on it;
#X msg 202 512 tmp/trainfile.dat;
#X obj 46 694 s \$0-to_net;
#X obj 46 68 t b b b;
#X msg 106 623 FANN_TRAIN_RPROP;
#X msg 106 646 FANN_TRAIN_QUICKPROP;
#X obj 46 577 t b b;
#X obj 187 265 * 2;
#X msg 46 671 train-on-file tmp/trainfile.dat;
#X msg 122 314 create \$1 \$2 3 \$3 1 0.7;
#X msg 363 612 set_activation_function_output FANN_LINEAR;
#X msg 364 583 set_activation_function_hidden FANN_LINEAR;
#X msg 372 669 randomize_weights -0.1 0.1;
#X msg 365 643 desired_error 0.001;
#X connect 4 0 6 0;
#X connect 5 0 4 0;
#X connect 6 0 7 0;
#X connect 7 0 12 0;
#X connect 7 0 15 2;
#X connect 9 1 12 1;
#X connect 9 1 15 3;
#X connect 9 1 15 1;
#X connect 9 1 26 0;
#X connect 10 0 9 0;
#X connect 11 0 5 0;
#X connect 11 1 10 0;
#X connect 12 0 28 0;
#X connect 14 0 22 0;
#X connect 15 0 16 0;
#X connect 16 0 0 1;
#X connect 17 0 0 0;
#X connect 18 0 17 0;
#X connect 18 1 15 0;
#X connect 18 2 20 0;
#X connect 20 0 0 2;
#X connect 22 0 25 0;
#X connect 22 1 18 0;
#X connect 22 2 11 0;
#X connect 24 0 21 0;
#X connect 25 0 27 0;
#X connect 25 1 31 0;
#X connect 25 1 32 0;
#X connect 25 1 24 0;
#X connect 26 0 12 2;
#X connect 27 0 21 0;
#X connect 28 0 13 0;
#X connect 31 0 21 0;
#X connect 32 0 21 0;
#X restore 80 222 pd train_net_on_datasets;
#X text 37 178 generate new net and train it on the datasets:;
#X text 35 263 the neural net:;
#N canvas 0 564 450 300 nn_for_samples 0;
#X obj 72 63 r \$0-to_net;
#X obj 72 125 h_maxlist;
#X obj 72 243 outlet;
#X text 72 267 index;
#X obj 177 198 h_vector sample_pool;
#X msg 177 175 get \$1;
#X obj 177 241 outlet;
#X text 176 263 samplename;
#X obj 177 219 unpack s;
#X obj 91 175 print;
#N canvas 265 255 690 335 training 0;
#X obj 71 288 outlet;
#X msg 82 195 FANN_TRAIN_INCREMENTAL;
#X msg 82 216 FANN_TRAIN_BATCH;
#X msg 81 238 FANN_TRAIN_RPROP;
#X msg 81 258 FANN_TRAIN_QUICKPROP;
#X text 40 28 you can set the training algorithm simply sending a message
with the name of the algorithm chosen. possible values are: FANN_TRAIN_INCREMENTAL
FANN_TRAIN_BATCH FANN_TRAIN_RPROP FANN_TRAIN_QUICKPROP the default
is: FANN_TRAIN_RPROP see the FANN manual for details on each algorithm:
http://fann.sourceforge.net/html/r1996.html;
#X connect 1 0 0 0;
#X connect 2 0 0 0;
#X connect 3 0 0 0;
#X connect 4 0 0 0;
#X restore 215 58 pd training algorithm;
#N canvas 371 92 698 395 training 0;
#X obj 52 230 outlet;
#X msg 69 118 desired_error 0.01;
#X msg 79 146 max_iterations 500000;
#X msg 90 178 iterations_between_reports 1000;
#X text 58 28 you can change training parameters. see FANN manual for
details (http://fann.sourceforge.net);
#X connect 1 0 0 0;
#X connect 2 0 0 0;
#X connect 3 0 0 0;
#X restore 216 84 pd training params;
#N canvas 371 92 694 391 activation 0;
#X obj 49 335 outlet;
#X text 40 28 you can set ti output activation algorithm passing a
message to nn. see the FANN manual for description of the algorithms
;
#X msg 69 118 set_activation_function_output FANN_THRESHOLD;
#X msg 83 139 set_activation_function_output FANN_THRESHOLD_SYMMETRIC
;
#X msg 95 163 set_activation_function_output FANN_LINEAR;
#X msg 98 184 set_activation_function_output FANN_SIGMOID;
#X msg 106 206 set_activation_function_output FANN_SIGMOID_STEPWISE
;
#X msg 108 233 set_activation_function_output FANN_SIGMOID_SYMMETRIC
;
#X msg 115 256 set_activation_function_output FANN_SIGMOID_SYMMETRIC_STEPWISE
;
#X connect 2 0 0 0;
#X connect 3 0 0 0;
#X connect 4 0 0 0;
#X connect 5 0 0 0;
#X connect 6 0 0 0;
#X connect 7 0 0 0;
#X connect 8 0 0 0;
#X restore 215 108 pd activation algorithm;
#X msg 109 33 print;
#X msg 114 9 learnrate 1;
#X obj 83 96 ann_mlp;
#X msg 235 20 load tmp/testnet.ann;
#X connect 0 0 15 0;
#X connect 1 0 2 0;
#X connect 1 0 5 0;
#X connect 4 0 8 0;
#X connect 5 0 4 0;
#X connect 8 0 6 0;
#X connect 13 0 15 0;
#X connect 14 0 15 0;
#X connect 15 0 1 0;
#X connect 15 0 9 0;
#X connect 16 0 15 0;
#X restore 90 293 pd nn_for_samples;
#X floatatom 90 310 5 0 0 0 index - -;
#X symbolatom 171 310 15 0 0 0 file - -;
#X obj 80 202 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
#X obj 396 300 s \$0-to_net;
#N canvas 19 332 538 494 make_random_datasets_for_testing 0;
#X text 26 17 make 200 8-dimensional random datasets \, for testing
;
#X obj 152 158 h_randfloat -1 1;
#X obj 193 198 h_randfloat -1 1;
#X obj 170 178 h_randfloat -1 1;
#X obj 212 218 h_randfloat -1 1;
#X obj 276 157 h_randfloat -1 1;
#X obj 313 198 h_randfloat -1 1;
#X obj 294 177 h_randfloat -1 1;
#X obj 336 217 h_randfloat -1 1;
#X obj 43 377 pack s f f f f f f f f;
#X obj 43 126 t f b;
#X obj 43 261 makefilename sample%d.wav;
#X obj 43 438 outlet;
#X obj 43 52 inlet;
#X obj 108 52 inlet;
#X obj 43 91 h_for 10;
#X connect 1 0 9 1;
#X connect 2 0 9 3;
#X connect 3 0 9 2;
#X connect 4 0 9 4;
#X connect 5 0 9 5;
#X connect 6 0 9 7;
#X connect 7 0 9 6;
#X connect 8 0 9 8;
#X connect 9 0 12 0;
#X connect 10 0 11 0;
#X connect 10 1 1 0;
#X connect 10 1 3 0;
#X connect 10 1 2 0;
#X connect 10 1 4 0;
#X connect 10 1 5 0;
#X connect 10 1 7 0;
#X connect 10 1 6 0;
#X connect 10 1 8 0;
#X connect 11 0 9 0;
#X connect 13 0 15 0;
#X connect 14 0 15 1;
#X connect 15 0 10 0;
#X restore 158 387 pd make_random_datasets_for_testing;
#X obj 158 365 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
#N canvas 0 0 989 300 8-dimen-dataset 0;
#X obj 27 40 inlet;
#X obj 73 40 inlet;
#X obj 73 63 t b f;
#X obj 118 40 inlet;
#X obj 118 63 t b f;
#X obj 163 40 inlet;
#X obj 163 63 t b f;
#X obj 208 40 inlet;
#X obj 208 63 t b f;
#X obj 252 40 inlet;
#X obj 252 63 t b f;
#X obj 297 40 inlet;
#X obj 297 63 t b f;
#X obj 342 40 inlet;
#X obj 342 63 t b f;
#X obj 127 201 pack 0 0 0 0 0 0 0 0;
#X obj 337 257 outlet;
#X obj 422 39 inlet;
#X text 418 20 random;
#X obj 422 104 h_randfloat -1 1;
#X obj 477 145 h_randfloat -1 1;
#X obj 454 125 h_randfloat -1 1;
#X obj 496 165 h_randfloat -1 1;
#X obj 560 104 h_randfloat -1 1;
#X obj 597 145 h_randfloat -1 1;
#X obj 578 124 h_randfloat -1 1;
#X obj 620 164 h_randfloat -1 1;
#X obj 422 63 t b b;
#X obj 422 207 pack 0 0 0 0 0 0 0 0;
#X connect 0 0 15 0;
#X connect 1 0 2 0;
#X connect 2 0 15 0;
#X connect 2 1 15 1;
#X connect 3 0 4 0;
#X connect 4 0 15 0;
#X connect 4 1 15 2;
#X connect 5 0 6 0;
#X connect 6 0 15 0;
#X connect 6 1 15 3;
#X connect 7 0 8 0;
#X connect 8 0 15 0;
#X connect 8 1 15 4;
#X connect 9 0 10 0;
#X connect 10 0 15 0;
#X connect 10 1 15 5;
#X connect 11 0 12 0;
#X connect 12 0 15 0;
#X connect 12 1 15 6;
#X connect 13 0 14 0;
#X connect 14 0 15 0;
#X connect 14 1 15 7;
#X connect 15 0 16 0;
#X connect 17 0 27 0;
#X connect 19 0 28 0;
#X connect 20 0 28 2;
#X connect 21 0 28 1;
#X connect 22 0 28 3;
#X connect 23 0 28 4;
#X connect 24 0 28 6;
#X connect 25 0 28 5;
#X connect 26 0 28 7;
#X connect 27 0 19 0;
#X connect 27 1 23 0;
#X connect 27 1 21 0;
#X connect 27 1 25 0;
#X connect 27 1 20 0;
#X connect 27 1 24 0;
#X connect 27 1 22 0;
#X connect 27 1 26 0;
#X connect 28 0 16 0;
#X restore 467 441 pd 8-dimen-dataset;
#X obj 467 382 vsl 15 50 -1 1 0 0 empty empty empty 0 -8 0 8 -262144
-1 -1 0 1;
#X obj 484 382 vsl 15 50 -1 1 0 0 empty empty empty 0 -8 0 8 -262144
-1 -1 0 1;
#X obj 501 382 vsl 15 50 -1 1 0 0 empty empty empty 0 -8 0 8 -262144
-1 -1 0 1;
#X obj 518 382 vsl 15 50 -1 1 0 0 empty empty empty 0 -8 0 8 -262144
-1 -1 0 1;
#X obj 536 382 vsl 15 50 -1 1 0 0 empty empty empty 0 -8 0 8 -262144
-1 -1 0 1;
#X obj 553 382 vsl 15 50 -1 1 0 0 empty empty empty 0 -8 0 8 -262144
-1 -1 0 1;
#X obj 570 382 vsl 15 50 -1 1 0 0 empty empty empty 0 -8 0 8 -262144
-1 -1 0 1;
#X obj 587 382 vsl 15 50 -1 1 0 0 empty empty empty 0 -8 0 8 -262144
-1 -1 0 1;
#X text 465 338 8 dimensional:;
#X obj 467 463 s \$0-to_net;
#X obj 600 442 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
#X msg 511 353 0;
#X msg 377 370 250;
#X obj 420 92 cnv 15 1 1 empty empty 1 5 7 0 8 -241291 -241291 0;
#X obj 412 195 cnv 15 1 1 empty empty 2 5 7 0 8 -241291 -241291 0;
#X obj 415 215 cnv 15 1 1 empty empty 3 5 7 0 8 -241291 -241291 0;
#X obj 434 200 cnv 15 1 1 empty empty 4 5 7 0 8 -241291 -241291 0;
#X obj 476 160 cnv 15 1 1 empty empty 5 5 7 0 8 -241291 -241291 0;
#X obj 485 230 cnv 15 1 1 empty empty 6 5 7 0 8 -241291 -241291 0;
#X obj 501 177 cnv 15 1 1 empty empty 7 5 7 0 8 -241291 -241291 0;
#X obj 508 198 cnv 15 1 1 empty empty 8 5 7 0 8 -241291 -241291 0;
#X obj 526 125 cnv 15 1 1 empty empty 9 5 7 0 8 -241291 -241291 0;
#X obj 537 223 cnv 15 1 1 empty empty 0 5 7 0 8 -241291 -241291 0;
#X msg 50 64 sample9.wav 0.34 0.26;
#X msg 223 64 readXML tmp/2d-data.xml;
#X connect 0 0 1 0;
#X connect 0 1 2 0;
#X connect 1 0 3 0;
#X connect 2 0 3 1;
#X connect 3 0 16 0;
#X connect 5 0 4 0;
#X connect 6 0 4 0;
#X connect 7 0 4 0;
#X connect 12 0 13 0;
#X connect 12 1 14 0;
#X connect 15 0 9 0;
#X connect 18 0 17 0;
#X connect 19 0 29 0;
#X connect 20 0 19 0;
#X connect 21 0 19 1;
#X connect 22 0 19 2;
#X connect 23 0 19 3;
#X connect 24 0 19 4;
#X connect 25 0 19 5;
#X connect 26 0 19 6;
#X connect 27 0 19 7;
#X connect 30 0 19 8;
#X connect 31 0 20 0;
#X connect 31 0 21 0;
#X connect 31 0 22 0;
#X connect 31 0 23 0;
#X connect 31 0 24 0;
#X connect 31 0 25 0;
#X connect 31 0 26 0;
#X connect 31 0 27 0;
#X connect 32 0 17 1;
#X connect 43 0 6 0;
#X connect 44 0 4 0;
|