diff --git a/test/test-mlp1.js b/test/test-mlp1.js new file mode 100644 index 0000000..892283b --- /dev/null +++ b/test/test-mlp1.js @@ -0,0 +1,29 @@ +var x = [[1,1,1,0,0,0], + [1,0,1,0,0,0], + [1,1,1,0,0,0], + [0,0,1,1,1,0], + [0,0,1,1,0,0], + [0,0,1,1,1,0]]; +var y = [[1, 0], + [1, 0], + [1, 0], + [0, 1], + [0, 1], + [0, 1]]; +var model = ml.learner({ + algorithm : ml.ML.MLP, + x : x, + y : y, + hidden_layers : [4,4,5] +}); + +var result = ml.train(model,{ + epochs : 20000, +}) +print (result) +print(toJSON(model).length+' Bytes') + +a = [[1, 1, 0, 0, 0, 0], + [0, 0, 0, 1, 1, 0], + [1, 1, 1, 1, 1, 0]]; +print(ml.classify(model,a));