Exemplo n.º 1
0
        public void TestPruneNeuronOutput()
        {
            BasicNetwork network = ObtainNetwork();

            Assert.AreEqual(4, network.OutputCount);
            PruneSelective prune = new PruneSelective(network);

            prune.Prune(2, 1);
            Assert.AreEqual(21, network.EncodedArrayLength());
            Assert.AreEqual(3, network.GetLayerNeuronCount(2));
            Assert.AreEqual("1,2,3,4,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25", network.DumpWeights());

            BasicNetwork model = EncogUtility.SimpleFeedForward(2, 3, 0, 3, false);

            CheckWithModel(model.Structure.Flat, network.Structure.Flat);
            Assert.AreEqual(3, network.OutputCount);
        }