Index: trunk/Ohana/src/opihi/cmd.data/nnet.c
===================================================================
--- trunk/Ohana/src/opihi/cmd.data/nnet.c	(revision 40319)
+++ trunk/Ohana/src/opihi/cmd.data/nnet.c	(revision 40320)
@@ -4,5 +4,5 @@
   {1, "list",     nnet_list,     "list nnets"},
   {1, "delete",   nnet_delete,   "delete a nnet"},
-  {1, "show",     nnet_show,     "display nnet values"},
+  // {1, "show",     nnet_show,     "display nnet values"},
   {1, "create",   nnet_create,   "create a nnet"},
   {1, "set",      nnet_set,      "set nnet node values"},
Index: trunk/Ohana/src/opihi/cmd.data/nnet_commands.c
===================================================================
--- trunk/Ohana/src/opihi/cmd.data/nnet_commands.c	(revision 40319)
+++ trunk/Ohana/src/opihi/cmd.data/nnet_commands.c	(revision 40320)
@@ -14,5 +14,4 @@
 int nnet_delete (int argc, char **argv) {
 
-# if (0)
   int status;
   Nnet *nnet;
@@ -31,27 +30,4 @@
   status = DeleteNnet (nnet);
   if (!status) abort ();
-# endif
-
-  return TRUE;
-}
-
-int nnet_show (int argc, char **argv) {
-
-# if (0)
-  Nnet *nnet;
-
-  if (argc != 2) {
-    gprint (GP_ERR, "USAGE: nnet listnnet (nnet)\n");
-    return FALSE;
-  }
-
-  nnet = FindNnet (argv[1]);
-  if (nnet == NULL) {
-    gprint (GP_ERR, "nnet %s not found\n", argv[1]);
-    return FALSE;
-  }
-
-  ListPages (nnet);
-# endif
 
   return TRUE;
@@ -60,5 +36,5 @@
 int nnet_create (int argc, char **argv) {
 
-  if (argc < 5) {
+  if (argc < 4) {
     gprint (GP_ERR, "USAGE: nnet create (nnet) (Ninput) [Nnodes] [Nnodes] ... (Noutput)\n");
     return FALSE;
@@ -86,5 +62,5 @@
   Vector *vector;
 
-  if (argc < 5) {
+  if (argc < 4) {
     gprint (GP_ERR, "USAGE: nnet set (nnet) [weights] [biases] ... [weights] [biases] : set nnet weights (images) and biases (vectors)\n");
     return FALSE;
@@ -98,5 +74,5 @@
 
   // compare argc and nnet[0].Nlayer 
-  if (argc - 2 != nnet[0].Nlayer * 2) {
+  if (argc - 2 != (nnet[0].Nlayer - 1) * 2) {
     gprint (GP_ERR, "ERROR: invalid number of arguments\n");
     gprint (GP_ERR, "USAGE: nnet set (nnet) [weights] [biases] ... [weights] [biases] : set nnet weights (images) and biases (vectors)\n");
@@ -164,5 +140,5 @@
   Vector *vector;
 
-  if (argc < 5) {
+  if (argc < 4) {
     gprint (GP_ERR, "USAGE: nnet get (nnet) [weights] [biases] ... [weights] [biases] : get nnet weights (images) and biases (vectors)\n");
     return FALSE;
@@ -176,5 +152,5 @@
 
   // compare argc and nnet[0].Nlayer 
-  if (argc - 2 != nnet[0].Nlayer * 2) {
+  if (argc - 2 != (nnet[0].Nlayer - 1) * 2) {
     gprint (GP_ERR, "ERROR: invalid number of arguments\n");
     gprint (GP_ERR, "USAGE: nnet set (nnet) [weights] [biases] ... [weights] [biases] : set nnet weights (images) and biases (vectors)\n");
Index: trunk/Ohana/src/opihi/cmd.data/test/nnet.sh
===================================================================
--- trunk/Ohana/src/opihi/cmd.data/test/nnet.sh	(revision 40319)
+++ trunk/Ohana/src/opihi/cmd.data/test/nnet.sh	(revision 40320)
@@ -4,3 +4,120 @@
   nnet create t0 5 10 15 3
   nnet list
+
+  nnet create t1 5 8
+  nnet list
+
+  # vlist v0 1 2 3 4 5
+  vlist v1 1 2 3 4 5 6 7 8
+
+  mcreate m1 5 8
+  
+  # generate a weight vector of length v1[]
+  vlist my 9 8 7 6 5 4 3 2
+
+  for i 0 5
+    mset m1 my -y $i
+    set my = my + $i
+  end
+  
+  # set weights and biases
+  nnet set t1 m1 v1
+
+  # get weights and biases
+  nnet get t1 M1 V1
+
+  # compare
+  set dv = v1 - V1
+  vstat dv
+
+  set dm = m1 - M1
+  stat dm
+  
 end
+
+macro test2
+
+  nnet create t1 2 2
+  nnet list
+
+  # output = sigmoid (sum(weight[i][j] * input[i]) + bias[j])
+
+  # biases of 
+  vlist v1 0.8 0.2
+
+  mcreate m1 2 2
+  m1[0][0] =  0.5
+  m1[1][0] =  0.1
+  m1[0][1] = -0.2
+  m1[1][1] =  0.8
+
+  # set weights and biases
+  nnet set t1 m1 v1
+
+  vlist vin0 1 2
+  vlist vin1 2 1
+
+  # get weights and biases
+  nnet apply t1 vin0 vin1 vout0 vout1
+  
+  vlist z0 {m1[0][0]*vin0[0] + m1[1][0]*vin1[0] + v1[0]} {m1[0][0]*vin0[1] + m1[1][0]*vin1[1] + v1[0]} 
+  vlist z1 {m1[0][1]*vin0[0] + m1[1][1]*vin1[0] + v1[1]} {m1[0][1]*vin0[1] + m1[1][1]*vin1[1] + v1[1]}
+  set t0 = 1 / (1 + exp(-1*z0))
+  set t1 = 1 / (1 + exp(-1*z1))
+
+  # compare
+  set dt0 = t0 - vout0
+  vstat dt0
+
+  set dt1 = t1 - vout1
+  vstat dt1
+end
+
+macro test3
+
+  memory all
+
+  nnet create t0 5 10 15 3
+  nnet list
+
+  nnet create t1 5 8
+  nnet list
+
+  # vlist v0 1 2 3 4 5
+  vlist v1 1 2 3 4 5 6 7 8
+
+  mcreate m1 5 8
+  
+  # generate a weight vector of length v1[]
+  vlist my 9 8 7 6 5 4 3 2
+
+  for i 0 5
+    mset m1 my -y $i
+    set my = my + $i
+  end
+  
+  # set weights and biases
+  nnet set t1 m1 v1
+
+  # get weights and biases
+  nnet get t1 M1 V1
+
+  # compare
+  set dv = v1 - V1
+  vstat dv
+
+  set dm = m1 - M1
+  stat dm
+  
+  nnet delete t0
+  nnet delete t1
+
+  delete m1 M1 dm
+  delete v1 V1 dv my
+
+  vectors
+  buffers
+
+  memory all
+end
+
