From 4312ee11164e7f750e11919249a3ac1f6f29e5ab Mon Sep 17 00:00:00 2001 From: sneedgroup-holder Date: Tue, 3 Dec 2024 23:10:23 +0000 Subject: [PATCH] sam: begin demi of different length. --- sam-neurons-words.js | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/sam-neurons-words.js b/sam-neurons-words.js index 1cf623a..39c909c 100644 --- a/sam-neurons-words.js +++ b/sam-neurons-words.js @@ -94,13 +94,16 @@ class NeuralNetwork { // Example usage: // Example dataset (XOR problem) -let strings = ["hello", "neural", "world"] +let strings = ["hello", "neural", "world", "how are", "you", "?"] let inputs = [ - [0, 0, 0], - [1, 0, 0], - [1, 0, 1], - [1, 1, 1] + [0, 0, 0, 0, 0 ,0], + [1, 0, 0, 0, 0, 0], + [1, 0, 1, 0, 0, 0], + [1, 1, 1, 0, 0, 0], + [1, 1, 1, 0, 1, 0], + [1, 1, 1, 0, 1, 1], + [1, 1, 1, 1, 1, 1] ]; let nn = new NeuralNetwork(strings.length, inputs.length, 1); // Increased hidden nodes to 4 @@ -109,7 +112,10 @@ let targets = [ [0], [1], [2], - [3] + [3], + [4], + [5], + [6] ]; if (targets.length != inputs.length) {