From 8c921fd80c34d9c2a20dcc78e259163e27c76912 Mon Sep 17 00:00:00 2001 From: Georg Holzmann Date: Wed, 31 Aug 2005 19:30:58 +0000 Subject: a new example - needs much externals, but should only should how to use the new extensions ... svn path=/trunk/externals/ann/; revision=3469 --- examples/ann_mlp_example4/gen_trainfile.pd | 180 +++++++++++++++++++++++++++++ 1 file changed, 180 insertions(+) create mode 100755 examples/ann_mlp_example4/gen_trainfile.pd (limited to 'examples/ann_mlp_example4/gen_trainfile.pd') diff --git a/examples/ann_mlp_example4/gen_trainfile.pd b/examples/ann_mlp_example4/gen_trainfile.pd new file mode 100755 index 0000000..0f134e4 --- /dev/null +++ b/examples/ann_mlp_example4/gen_trainfile.pd @@ -0,0 +1,180 @@ +#N canvas 60 0 578 726 10; +#X obj 60 466 inlet; +#X text 95 228 ; +#X text 98 248 nr of tests = with how many datasets; +#X text 197 262 should be trained; +#X text 97 282 nr of inputs = inputs of the neural net; +#X text 98 304 nr of outputs = outputs of the neural net; +#X text 100 380 ... ...; +#X obj 418 542 textfile; +#X text 59 190 1) set filename at 3.inlet; +#X text 59 210 2) set the following list at 2 inlet:; +#X text 61 334 3) pass the datasets as a list (one after the other) +into 1.inlet \, one list contains the input and desired output values +\, like:; +#X text 50 443 datalist; +#X obj 230 467 inlet; +#X text 229 448 header; +#X text 40 169 INLETS:; +#X obj 419 466 inlet; +#X text 410 447 filename; +#N canvas 0 0 450 300 write_header 0; +#X obj 30 29 inlet; +#X obj 30 67 t l b b; +#X obj 30 256 s \$0-textfile; +#X msg 74 97 clear; +#X msg 52 135 rewind; +#X msg 30 165 add \$1 \$2 \$3; +#X obj 170 79 unpack f f f; +#X obj 170 111 s \$0-size; +#X obj 209 138 s \$0-ins; +#X obj 181 206 s \$0-ok_for_new_datasets; +#X msg 181 180 1; +#X connect 0 0 1 0; +#X connect 0 0 6 0; +#X connect 1 0 5 0; +#X connect 1 1 4 0; +#X connect 1 2 3 0; +#X connect 1 2 10 0; +#X connect 3 0 2 0; +#X connect 4 0 2 0; +#X connect 5 0 2 0; +#X connect 6 0 7 0; +#X connect 6 1 8 0; +#X connect 10 0 9 0; +#X restore 230 493 pd write_header; +#X obj 418 521 r \$0-textfile; +#N canvas 672 100 450 561 write_datasets 0; +#X obj 25 34 inlet; +#X obj 25 487 outlet; +#X obj 242 160 niagara; +#X obj 298 159 r \$0-ins; +#X obj 303 223 lister; +#X msg 221 250 add; +#X obj 242 195 t b b l; +#X obj 303 245 t b l; +#X msg 304 271 add; +#X obj 273 340 s \$0-textfile; +#X obj 221 277 iem_append; +#X obj 304 298 iem_append; +#X obj 139 339 s \$0-write; +#X obj 62 92 r \$0-ok_for_new_datasets; +#X obj 25 115 spigot; +#X obj 25 143 t b l; +#N canvas 115 166 450 464 count_datasets 0; +#X obj 86 247 f; +#X obj 86 98 inlet; +#X msg 147 247 0; +#X obj 147 216 loadbang; +#X obj 86 366 outlet; +#X obj 116 247 + 1; +#X obj 86 284 % \$1; +#X text 89 74 bang; +#X text 248 125 modulo; +#X text 147 80 reset; +#X obj 249 268 - 1; +#X obj 230 304 sel; +#X obj 230 365 outlet; +#X text 219 389 bang after; +#X text 220 403 one circle; +#X text 83 389 numbers; +#X obj 201 248 f \$1; +#X obj 86 193 t b; +#X obj 249 146 r \$0-size; +#X obj 147 98 r \$0-ok_for_new_datasets; +#X obj 147 120 sel 1; +#X connect 0 0 6 0; +#X connect 1 0 17 0; +#X connect 2 0 0 1; +#X connect 3 0 2 0; +#X connect 3 0 16 0; +#X connect 5 0 0 1; +#X connect 6 0 5 0; +#X connect 6 0 4 0; +#X connect 6 0 11 0; +#X connect 10 0 11 1; +#X connect 11 0 12 0; +#X connect 16 0 10 0; +#X connect 17 0 0 0; +#X connect 18 0 6 1; +#X connect 18 0 10 0; +#X connect 19 0 20 0; +#X connect 20 0 2 0; +#X restore 25 237 pd count_datasets; +#X obj 139 396 s \$0-ok_for_new_datasets; +#X msg 139 376 0; +#X obj 139 487 outlet; +#X obj 25 58 t l b; +#N canvas 0 0 450 300 WARNINGS 0; +#X obj 20 22 inlet; +#X obj 20 114 == 0; +#X obj 36 54 r \$0-ok_for_new_datasets; +#X obj 20 206 print gen_trainfile_WARNING; +#X obj 20 81 f 0; +#X msg 20 178 file is full or create new header; +#X obj 20 141 sel 1; +#X connect 0 0 4 0; +#X connect 1 0 6 0; +#X connect 2 0 4 1; +#X connect 4 0 1 0; +#X connect 5 0 3 0; +#X connect 6 0 5 0; +#X restore 289 75 pd WARNINGS; +#X obj 25 461 + 1; +#X connect 0 0 20 0; +#X connect 2 0 6 0; +#X connect 2 1 4 1; +#X connect 3 0 2 1; +#X connect 4 0 7 0; +#X connect 5 0 10 0; +#X connect 6 0 4 0; +#X connect 6 1 5 0; +#X connect 6 2 10 1; +#X connect 7 0 8 0; +#X connect 7 1 11 1; +#X connect 8 0 11 0; +#X connect 10 0 9 0; +#X connect 11 0 9 0; +#X connect 13 0 14 1; +#X connect 14 0 15 0; +#X connect 15 0 16 0; +#X connect 15 1 2 0; +#X connect 16 0 22 0; +#X connect 16 1 18 0; +#X connect 16 1 12 0; +#X connect 16 1 19 0; +#X connect 18 0 17 0; +#X connect 20 0 14 0; +#X connect 20 1 21 0; +#X connect 22 0 1 0; +#X restore 60 495 pd write_datasets; +#X text 39 118 NEEDED EXTERNALS: zexy and iemlib (http://pd.iem.at) +; +#N canvas 832 484 389 329 write_file 0; +#X obj 29 37 inlet; +#X obj 96 151 symbol; +#X obj 96 91 r \$0-write; +#X msg 96 177 write \$1 cr; +#X obj 96 203 s \$0-textfile; +#X obj 133 126 symbol; +#X connect 0 0 5 0; +#X connect 1 0 3 0; +#X connect 2 0 1 0; +#X connect 3 0 4 0; +#X connect 5 0 1 1; +#X restore 419 488 pd write_file; +#X text 40 137 HOW TO Use it: (see also help file); +#X obj 60 561 outlet; +#X obj 222 563 outlet; +#X text 48 583 written datasets; +#X text 216 585 file is ready and written (bang); +#X text 134 658 (c) 2005 \, Georg Holzmann ; +#X text 72 72 This abstraction generates a trainig file for ann_mlp +and ann_td.; +#X text 192 25 ::::_gen_trainfile_::::; +#X connect 0 0 19 0; +#X connect 12 0 17 0; +#X connect 15 0 21 0; +#X connect 18 0 7 0; +#X connect 19 0 23 0; +#X connect 19 1 24 0; -- cgit v1.2.1