Changeset 40322 for trunk/Ohana/src/opihi/cmd.data/test/nnet.sh
- Timestamp:
- Jan 24, 2018, 8:16:32 PM (8 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/opihi/cmd.data/test/nnet.sh (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/cmd.data/test/nnet.sh
r40320 r40322 3 3 4 4 nnet create t0 5 10 15 3 5 nnet list 6 7 nnet create t1 6 4 5 5 8 nnet list 6 9 … … 122 125 end 123 126 127 macro test.simple 128 129 # create a nnet with just 2 inputs and 2 outputs 130 nnet create t1 2 2 131 132 # biases: 133 vlist v1 0.5 0.0 134 135 # weights 136 mcreate m1 2 2 137 m1[0][0] = 0.5 138 m1[1][0] = -0.2 139 m1[0][1] = -0.5 140 m1[1][1] = 0.2 141 142 # set weights and biases 143 nnet set t1 m1 v1 144 145 # generate an input set spanning the range -5 to +5 146 147 create n 0 1000 148 set x0 = 10*rnd(n) - 5.0 149 set x1 = 10*rnd(n) - 5.0 150 151 # get output vectors the these input vectors 152 nnet apply t1 x0 x1 y0 y1 153 154 nnet create tn 2 2 155 nnet train tn x0 x1 y0 y1 -Nmini 50 -Nepoch 50 156 157 nnet apply tn x0 x1 Y0 Y1 158 lim x0 y0; clear; box; plot -c black x0 y0; plot -c red x0 Y0 159 end 160
Note:
See TracChangeset
for help on using the changeset viewer.
