示例#1
0
 public void ActivateAll()
 {
     layerToTest.ActivateNeurons();
     foreach (Neuron inputNeuron in layerToTest.Neurons)
     {
         Assert.AreEqual(1, inputNeuron.Activation);
     }
 }
示例#2
0
        public void Scaffold_Testing_Layer()
        {
            activator    = new ReLU();
            layerToTest  = new Layer(5);
            learningRate = 0.01;

            layerToTest.InputToNeurons(neuronInput);


            testOutputLayer = new Layer(5, layerToTest, activator, 2); // generates a layer with all its neurons taking in the previous layer as inputs!
            // Essentially, this layer becomes the output to the previous layer

            // If this creation of the output layer worked, then by backpropping one of the neurons, all the previous neurons' errors should be 2
            testOutputLayer.InputToNeurons(neuronInput);
            testOutputLayer.ActivateNeurons();
            testOutputLayer.SetErrorNeurons(expectedOutput);
        }