IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 40322 for trunk


Ignore:
Timestamp:
Jan 24, 2018, 8:16:32 PM (8 years ago)
Author:
eugene
Message:

more tests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/cmd.data/test/nnet.sh

    r40320 r40322  
    33
    44  nnet create t0 5 10 15 3
     5  nnet list
     6
     7  nnet create t1 6 4 5
    58  nnet list
    69
     
    122125end
    123126
     127macro 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
     159end
     160
Note: See TracChangeset for help on using the changeset viewer.