Exemplo n.º 1
0
        public void EvaluateLayeredNetworkWithThreeLayersInputZeroOutputZero()
        {
            NeuronLayeredNetwork network = new NeuronLayeredNetwork(new int[] { 4, 5, 3 });

            var result = network.Evaluate(new double[] { 0.0, 0.0, 0.0, 0.0 });

            Assert.IsNotNull(result);
            Assert.AreEqual(3, result.Count);

            Assert.IsTrue(result.All(x => x == 0));
        }
Exemplo n.º 2
0
        public void EvaluateLayeredNetworkWithThreeLayersInputNonZero()
        {
            NeuronLayeredNetwork network = new NeuronLayeredNetwork(new int[] { 4, 5, 10 });

            var result = network.Evaluate(new double[] { 100.0, 100.0, 100.0, 100.0 });

            Assert.IsNotNull(result);
            Assert.AreEqual(10, result.Count);

            Assert.IsTrue(result.Any(x => x != 0));
        }
Exemplo n.º 3
0
        public void CreateLayeredNetworkWithThreeLayers()
        {
            NeuronLayeredNetwork network = new NeuronLayeredNetwork(new int[] { 4, 5, 3 });

            Assert.AreEqual(3, network.NLayers);
            Assert.IsNotNull(network.GetLayer(0));
            Assert.AreEqual(4, network.GetLayer(0).Count);
            Assert.IsNotNull(network.GetLayer(1));
            Assert.AreEqual(5, network.GetLayer(1).Count);
            Assert.IsNotNull(network.GetLayer(2));
            Assert.AreEqual(3, network.GetLayer(2).Count);
        }