From 1a5e352c099fe7d5d280850f35ff64727631d815 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sun, 9 Jun 2019 17:40:23 +0200 Subject: [PATCH] done --- NeuralNetwork.js | 162 ++++++++++++++++++++++++++++++++++ Neuron.js | 15 ++++ NeuronLayer.js | 14 +++ index.html | 225 +++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 416 insertions(+) create mode 100755 NeuralNetwork.js create mode 100755 Neuron.js create mode 100755 NeuronLayer.js create mode 100644 index.html diff --git a/NeuralNetwork.js b/NeuralNetwork.js new file mode 100755 index 0000000..c8d2667 --- /dev/null +++ b/NeuralNetwork.js @@ -0,0 +1,162 @@ +class NeuralNetwork +{ + constructor(numInputs, numOutputs, numHiddenLayers, numNeuronsPerHiddenLayer) + { + + this.numInputs = numInputs; + this.numOutputs = numOutputs; + this.numHiddenLayers = numHiddenLayers; + this.numNeuronsPerHiddenLayer = numNeuronsPerHiddenLayer; + + this.bias = 0.0; + this.activationResponse = 1.0; + this.neuronLayers = []; + + this.createNetwork(); + } + + createNetwork() + { + + //create the layers of the network + if (this.numHiddenLayers > 0) + { + //create first hidden layer + var firstHiddenLayer = new NeuronLayer(this.numNeuronsPerHiddenLayer, this.numInputs); + this.neuronLayers.push(firstHiddenLayer); + + for (var i=0; i + + + + + + + + + + +
+
+ + + +

+ +

+
+
+ +

+ +



+ +

+ +



+ +

+ +

+
+
+ +

+ +

+ +



+ +

+ +

+ +

+
+ +
+ + + +

+
+
+ + +