aboutsummaryrefslogtreecommitdiff
path: root/examples/ann_td/example.pd
diff options
context:
space:
mode:
Diffstat (limited to 'examples/ann_td/example.pd')
-rwxr-xr-xexamples/ann_td/example.pd316
1 files changed, 316 insertions, 0 deletions
diff --git a/examples/ann_td/example.pd b/examples/ann_td/example.pd
new file mode 100755
index 0000000..29b9b16
--- /dev/null
+++ b/examples/ann_td/example.pd
@@ -0,0 +1,316 @@
+#N canvas 520 90 539 296 12;
+#N canvas 103 30 724 595 guts 0;
+#X msg 89 147 0 \, destroy;
+#X obj 111 177 gemwin;
+#X msg 94 124 reset \, create \, 1;
+#X obj 331 165 gemhead;
+#X obj 331 186 translateXYZ;
+#X obj 402 118 * -1;
+#X obj 331 206 color 0.5 0 0;
+#X obj 383 66 gemmouse 8 8;
+#X obj 363 109 - 4;
+#X obj 405 99 - 4;
+#X obj 331 226 sphere 0.6;
+#X msg 156 102 cursor 0;
+#X msg 126 66 bang;
+#X msg 166 150 lighting 1;
+#N canvas 463 128 573 394 lights 0;
+#X obj 242 277 world_light;
+#X obj 242 163 gemhead 1;
+#X obj 242 225 rotateXYZ;
+#X msg 109 193 debug 0;
+#X msg 110 224 debug 1;
+#X text 20 169 figure out where the light is;
+#X obj 311 47 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 1 1
+;
+#X obj 354 133 pack f f;
+#X obj 334 159 line;
+#X msg 364 42 1;
+#X obj 364 23 loadbang;
+#X obj 344 298 world_light;
+#X obj 346 271 gemhead 1;
+#X obj 429 203 loadbang;
+#X obj 311 63 metro 20000;
+#X msg 400 104 10000;
+#X obj 119 57 delay 10000;
+#X msg 339 96 300;
+#X msg 292 96 50;
+#X msg 364 235 1 1 1;
+#X msg 422 266 0.6 0.3 0;
+#X connect 1 0 2 0;
+#X connect 2 0 0 0;
+#X connect 3 0 0 0;
+#X connect 4 0 0 0;
+#X connect 6 0 14 0;
+#X connect 7 0 8 0;
+#X connect 8 0 2 2;
+#X connect 9 0 6 0;
+#X connect 10 0 9 0;
+#X connect 10 0 15 0;
+#X connect 12 0 11 0;
+#X connect 13 0 19 0;
+#X connect 13 0 20 0;
+#X connect 14 0 17 0;
+#X connect 14 0 16 0;
+#X connect 15 0 7 1;
+#X connect 16 0 18 0;
+#X connect 17 0 7 0;
+#X connect 18 0 7 0;
+#X connect 19 0 0 1;
+#X connect 20 0 11 1;
+#X restore 543 135 pd lights;
+#X obj 269 139 s posx;
+#X obj 439 152 s posy;
+#X obj 225 25 inlet;
+#X obj 77 19 inlet;
+#X connect 0 0 1 0;
+#X connect 2 0 1 0;
+#X connect 3 0 4 0;
+#X connect 4 0 6 0;
+#X connect 5 0 4 2;
+#X connect 5 0 16 0;
+#X connect 6 0 10 0;
+#X connect 7 0 8 0;
+#X connect 7 1 9 0;
+#X connect 8 0 4 1;
+#X connect 8 0 15 0;
+#X connect 9 0 5 0;
+#X connect 11 0 1 0;
+#X connect 12 0 2 0;
+#X connect 12 0 13 0;
+#X connect 12 0 11 0;
+#X connect 13 0 1 0;
+#X connect 17 0 0 0;
+#X connect 18 0 12 0;
+#X restore 11 150 pd guts;
+#X obj 10 104 tgl 15 0 empty empty rendering 0 -6 0 8 -262144 -1 -1
+1 1;
+#X obj 47 128 bng 15 250 50 0 empty empty destroy_gemwin 0 -6 0 8 -262144
+-1 -1;
+#N canvas 209 7 826 609 train 0;
+#X floatatom 45 391 5 0 0 0 - - -;
+#X floatatom 83 390 5 0 0 0 - - -;
+#X floatatom 120 392 5 0 0 0 - - -;
+#X floatatom 160 394 5 0 0 0 - - -;
+#X obj 190 206 metro 100;
+#X obj 190 187 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
+1;
+#X obj 42 430 vsl 15 30 0 1 0 0 empty empty empty 0 -8 0 8 -262144
+-1 -1 2512 1;
+#X obj 80 430 vsl 15 30 0 1 0 0 empty empty empty 0 -8 0 8 -262144
+-1 -1 0 1;
+#X obj 115 430 vsl 15 30 0 1 0 0 empty empty empty 0 -8 0 8 -262144
+-1 -1 0 1;
+#X obj 154 434 vsl 15 30 0 1 0 0 empty empty empty 0 -8 0 8 -262144
+-1 -1 0 1;
+#X text 174 15 1- create the ann;
+#N canvas 503 57 704 411 train 0;
+#X obj 66 319 outlet;
+#X obj 213 183 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
+1;
+#X msg 84 16 train;
+#N canvas 0 0 490 340 outputs 0;
+#X obj 89 60 key;
+#X obj 41 122 sel 97;
+#X text 84 101 "a" key;
+#X obj 218 120 sel 115;
+#N canvas 0 0 458 308 a 0;
+#X obj 130 150 s output1;
+#X obj 86 76 inlet;
+#X text 88 56 bang;
+#X obj 241 80 inlet;
+#X text 243 60 reset;
+#X msg 86 101 1;
+#X msg 241 110 0;
+#X connect 1 0 5 0;
+#X connect 3 0 6 0;
+#X connect 5 0 0 0;
+#X connect 6 0 0 0;
+#X restore 41 145 pd a pressed;
+#N canvas 0 0 458 308 s 0;
+#X obj 86 76 inlet;
+#X text 88 56 bang;
+#X obj 241 80 inlet;
+#X text 243 60 reset;
+#X msg 86 101 1;
+#X msg 241 110 0;
+#X obj 130 150 s output2;
+#X connect 0 0 4 0;
+#X connect 2 0 5 0;
+#X connect 4 0 6 0;
+#X connect 5 0 6 0;
+#X restore 217 142 pd s pressed;
+#X text 295 92 "s" key;
+#X obj 228 57 keyup;
+#X obj 132 123 sel 97;
+#X obj 308 120 sel 115;
+#X floatatom 19 80 5 0 0 0 - - -;
+#X obj 39 183 sel 100;
+#X obj 130 184 sel 100;
+#X obj 216 181 sel 102;
+#X obj 306 181 sel 102;
+#N canvas 0 0 466 316 d 0;
+#X obj 86 76 inlet;
+#X text 88 56 bang;
+#X obj 241 80 inlet;
+#X text 243 60 reset;
+#X msg 86 101 1;
+#X msg 241 110 0;
+#X obj 130 150 s output3;
+#X connect 0 0 4 0;
+#X connect 2 0 5 0;
+#X connect 4 0 6 0;
+#X connect 5 0 6 0;
+#X restore 39 206 pd d pressed;
+#N canvas 0 0 470 320 f 0;
+#X obj 86 76 inlet;
+#X text 88 56 bang;
+#X obj 241 80 inlet;
+#X text 243 60 reset;
+#X msg 86 101 1;
+#X msg 241 110 0;
+#X obj 130 150 s output4;
+#X connect 0 0 4 0;
+#X connect 2 0 5 0;
+#X connect 4 0 6 0;
+#X connect 5 0 6 0;
+#X restore 215 203 pd f pressed;
+#X connect 0 0 1 0;
+#X connect 0 0 3 0;
+#X connect 0 0 10 0;
+#X connect 0 0 11 0;
+#X connect 0 0 13 0;
+#X connect 1 0 4 0;
+#X connect 3 0 5 0;
+#X connect 7 0 8 0;
+#X connect 7 0 9 0;
+#X connect 7 0 12 0;
+#X connect 7 0 14 0;
+#X connect 8 0 4 1;
+#X connect 9 0 5 1;
+#X connect 11 0 15 0;
+#X connect 12 0 15 1;
+#X connect 13 0 16 0;
+#X connect 14 0 16 1;
+#X restore 131 57 pd outputs;
+#X obj 130 87 r output1;
+#X obj 213 86 r output2;
+#X floatatom 130 108 5 0 0 0 - - -;
+#X floatatom 212 108 5 0 0 0 - - -;
+#X floatatom 297 106 5 0 0 0 - - -;
+#X floatatom 378 107 5 0 0 0 - - -;
+#X obj 297 85 r output3;
+#X obj 379 85 r output4;
+#X text 128 14 1- change to training mode;
+#X text 248 49 2- change keys if you want;
+#X text 264 61 defaults are "a" "s" "d" "f";
+#X text 239 182 3- toggle on to start training and off to stop;
+#X msg 170 282 run;
+#X text 200 283 4- switch to run mode when ready;
+#X obj 305 226 inlet;
+#X obj 344 256 nbx 8 14 -1e+037 1e+037 0 0 empty empty MSE 0 -6 0 10
+-262144 -1 -1 0 256;
+#N canvas 111 7 818 550 inputs 0;
+#X obj 107 65 r posx;
+#X obj 166 65 r posy;
+#X obj 68 103 f;
+#X obj 41 46 inlet;
+#X obj 55 300 outlet;
+#X obj 71 138 pack f f;
+#X connect 0 0 2 1;
+#X connect 1 0 5 1;
+#X connect 2 0 5 0;
+#X connect 3 0 2 0;
+#X connect 5 0 4 0;
+#X restore 213 226 pd inputs;
+#N canvas 84 111 802 315 merge 0;
+#X obj 56 34 inlet;
+#X obj 306 38 r output1;
+#X obj 382 38 r output2;
+#X obj 460 39 r output3;
+#X obj 537 39 r output4;
+#X obj 78 184 outlet;
+#X obj 56 73 unpack f f;
+#X obj 79 137 pack f f f f f f;
+#X connect 0 0 6 0;
+#X connect 1 0 7 2;
+#X connect 2 0 7 3;
+#X connect 3 0 7 4;
+#X connect 4 0 7 5;
+#X connect 6 0 7 0;
+#X connect 6 1 7 1;
+#X connect 7 0 5 0;
+#X restore 140 254 pd merge outputs;
+#X obj 213 202 metro 100;
+#X connect 1 0 22 0;
+#X connect 2 0 0 0;
+#X connect 4 0 6 0;
+#X connect 5 0 7 0;
+#X connect 10 0 8 0;
+#X connect 11 0 9 0;
+#X connect 16 0 0 0;
+#X connect 18 0 19 0;
+#X connect 20 0 21 0;
+#X connect 21 0 0 0;
+#X connect 22 0 20 0;
+#X restore 133 114 pd train on the fly;
+#X text 224 182 3- run the nn switching this metro ON;
+#X text 277 213 (note \, you must be in run mode);
+#X msg 281 231 run;
+#X text 364 275 4- when you are happy with you nn save it;
+#X obj 301 404 nbx 8 14 -1e+037 1e+037 0 0 empty empty mse 0 -6 0 10
+-262144 -1 -1 0 256;
+#X text 300 422 mse is usefull while training on-the-fly: tells you
+the global error in the net \, how much net's output differs from desired
+output.;
+#X text 325 115 2- train on the fly in realtime;
+#X obj 64 348 unpack f f f f;
+#X msg 249 279 save tdnn.net;
+#X msg 249 298 load tdnn.net;
+#X text 24 412 still;
+#X text 72 412 left;
+#X text 111 413 right;
+#X text 156 415 na;
+#X obj 66 325 ann_tdnn 2 5 tdnn.net;
+#N canvas 111 7 822 554 inputs 0;
+#X obj 107 65 r posx;
+#X obj 166 65 r posy;
+#X obj 68 103 f;
+#X obj 41 46 inlet;
+#X obj 55 300 outlet;
+#X obj 72 138 pack f f;
+#X connect 0 0 2 1;
+#X connect 1 0 5 1;
+#X connect 2 0 5 0;
+#X connect 3 0 2 0;
+#X connect 5 0 4 0;
+#X restore 156 245 pd inputs;
+#X msg 66 15 create 2 4 5;
+#X text 363 301 remember that you can load it also passing filename
+as the 3rd argument;
+#X connect 0 0 6 0;
+#X connect 1 0 7 0;
+#X connect 2 0 8 0;
+#X connect 3 0 9 0;
+#X connect 4 0 27 0;
+#X connect 5 0 4 0;
+#X connect 11 0 26 0;
+#X connect 14 0 26 0;
+#X connect 19 0 0 0;
+#X connect 19 1 1 0;
+#X connect 19 2 2 0;
+#X connect 19 3 3 0;
+#X connect 20 0 26 0;
+#X connect 21 0 26 0;
+#X connect 26 0 19 0;
+#X connect 26 1 16 0;
+#X connect 26 1 11 0;
+#X connect 27 0 26 0;
+#X connect 28 0 26 0;
+#X restore 9 224 pd train and run nn;
+#X text 94 94 1- start rendering;
+#X text 72 203 2- open the subpatch and follow instructions;
+#X text 15 5 TDNN implementation (Time Delay Neural Network) useful
+for gesture recognition;
+#X connect 1 0 0 0;
+#X connect 2 0 0 1;