IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 40323 for trunk


Ignore:
Timestamp:
Jan 25, 2018, 6:22:08 AM (8 years ago)
Author:
eugene
Message:

add option to set eta; update nnet test

Location:
trunk/Ohana/src/opihi/cmd.data
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/cmd.data/nnet_train.c

    r40319 r40323  
    3030 
    3131  float eta = 1.0; // XXX how do I set this? does it need to update?
     32  if ((N = get_argument (argc, argv, "-eta"))) {
     33    remove_argument (N, &argc, argv);
     34    eta = atof (argv[N]);
     35    remove_argument (N, &argc, argv);
     36  }
    3237
    3338  if (argc < 4) {
  • trunk/Ohana/src/opihi/cmd.data/test/nnet.sh

    r40322 r40323  
    126126
    127127macro test.simple
     128  if ($0 != 4)
     129    echo "USAGE: test.simple (Nmini) (Nepoch) (eta)"
     130    break
     131  end
     132
     133  local Nmini Nepoch eta
     134  $Nmini  = $1
     135  $Nepoch = $2
     136  $eta    = $3
    128137
    129138  # create a nnet with just 2 inputs and 2 outputs
     
    153162
    154163  nnet create tn 2 2
    155   nnet train tn x0 x1 y0 y1 -Nmini 50 -Nepoch 50
     164  nnet train tn x0 x1 y0 y1 -Nmini $Nmini -Nepoch $Nepoch -eta $eta
    156165
    157166  nnet apply tn x0 x1 Y0 Y1
    158   lim x0 y0; clear; box; plot -c black x0 y0; plot -c red x0 Y0
     167
     168  set dy0 = y0 - Y0
     169  set dy1 = y1 - Y1
     170
     171  vstat -q dy0
     172  $yp = $MAX
     173  $ym = $MIN
     174
     175  vstat -q dy1
     176  $yp = max ($MAX , $yp)
     177  $ym = min ($MIN , $ym)
     178  $yp = 0.02; $ym = -0.02
     179
     180  style -pt circle -sz 2; lim x0 $ym $yp; clear; box; plot -c blue x0 dy0; plot -c red x0 dy1
    159181end
    160182
Note: See TracChangeset for help on using the changeset viewer.