public void TestIncreaseNeuronCountHidden()
        {
            BasicNetwork network = XOR.CreateTrainedXOR();

            Assert.IsTrue(XOR.VerifyXOR(network, 0.10));
            PruneSelective prune = new PruneSelective(network);

            prune.ChangeNeuronCount(1, 5);

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

            CheckWithModel(model.Structure.Flat, network.Structure.Flat);

            Assert.IsTrue(XOR.VerifyXOR(network, 0.10));
        }
Exemplo n.º 2
0
        public void TestPersistEG()
        {
            IMLDataSet trainingSet = XOR.CreateXORDataSet();
            RBFNetwork network     = new RBFNetwork(2, 4, 1, RBFEnum.Gaussian);

            SVDTraining training = new SVDTraining(network, trainingSet);

            training.Iteration();
            XOR.VerifyXOR(network, 0.1);

            EncogDirectoryPersistence.SaveObject(EG_FILENAME, network);
            RBFNetwork network2 = (RBFNetwork)EncogDirectoryPersistence.LoadObject(EG_FILENAME);

            XOR.VerifyXOR(network2, 0.1);
        }
        public BasicPNN create()
        {
            PNNOutputMode mode = PNNOutputMode.Regression;

            BasicPNN network = new BasicPNN(PNNKernelType.Gaussian, mode, 2, 1);

            BasicMLDataSet trainingSet = new BasicMLDataSet(XOR.XORInput,
                                                            XOR.XORIdeal);

            TrainBasicPNN train = new TrainBasicPNN(network, trainingSet);

            train.Iteration();
            XOR.VerifyXOR(network, 0.001);
            return(network);
        }
 public void Validate(BasicNetwork network)
 {
     network.ClearContext();
     XOR.VerifyXOR(network, 0.1);
 }
Exemplo n.º 5
0
 public void Validate(FreeformNetwork network)
 {
     network.ClearContext();
     XOR.VerifyXOR(network, 0.1);
 }