From 357697823f3c2c81aee239e153c82bb589441582 Mon Sep 17 00:00:00 2001 From: sbosse Date: Tue, 27 Aug 2024 00:15:45 +0200 Subject: [PATCH] Tue 27 Aug 00:14:56 CEST 2024 --- test/test-slp3.js | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 test/test-slp3.js diff --git a/test/test-slp3.js b/test/test-slp3.js new file mode 100644 index 0000000..3a802bb --- /dev/null +++ b/test/test-slp3.js @@ -0,0 +1,27 @@ +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, + 1, + 1, + 0, + 0, + 0]; +var t0=time(); +var model = ml.learn({ + algorithm : ml.ML.SLP, + x : x, + y : y, + epochs : 20000, +}); +var t1=time() + +print(toJSON(model).length+' Bytes') +print((t1-t0)+'ms'); +a = [[1, 1, 0, 0, 0, 0], + [0, 0, 0, 1, 1, 0], + [1, 1, 1, 1, 1, 0]]; +print(ml.classify(model,a));