示例#1
0
        public static FeedforwardNetwork loadNetwork()
        {
            FeedforwardNetwork result = (FeedforwardNetwork)SerializeObject
                                        .Load("tictactoe.net");

            return(result);
        }
示例#2
0
 public YearBornBot()
 {
     this.network = (FeedforwardNetwork)SerializeObject
                    .Load(Config.FILENAME_WHENBORN_NET);
     this.histogram = (WordHistogram)SerializeObject
                      .Load(Config.FILENAME_HISTOGRAM);
 }
示例#3
0
        public double TestSingle(double[] input)
        {
            double[]     outPut  = new double[1];
            BasicNetwork network = (BasicNetwork)SerializeObject.Load(networkFile);

            network.Compute(input, outPut);
            //Console.Write("The chance of winning is: " + Math.Round(output[0]*100,2) + "% | ");
            return(outPut[0]);
        }
示例#4
0
        public void TestPersistSerial()
        {
            SupportVectorMachine network = Create();

            SerializeObject.Save(SERIAL_FILENAME.ToString(), network);
            SupportVectorMachine network2 = (SupportVectorMachine)SerializeObject.Load(SERIAL_FILENAME.ToString());

            Validate(network2);
        }
        public void TestPersistSerial()
        {
            BasicPNN network = create();

            SerializeObject.Save(SERIAL_FILENAME.ToString(), network);
            BasicPNN network2 = (BasicPNN)SerializeObject.Load(SERIAL_FILENAME.ToString());

            XOR.VerifyXOR(network2, 0.001);
        }
示例#6
0
        public void TestContPersistSerial()
        {
            HiddenMarkovModel sourceHMM = BuildContHMM();

            SerializeObject.Save(SERIAL_FILENAME.ToString(), sourceHMM);
            HiddenMarkovModel resultHMM = (HiddenMarkovModel)SerializeObject.Load(SERIAL_FILENAME.ToString());

            Validate(resultHMM, sourceHMM);
        }
        public void TestPersistSerial()
        {
            NEATPopulation pop = Generate();

            SerializeObject.Save(SERIAL_FILENAME.ToString(), pop);
            NEATPopulation pop2 = (NEATPopulation)SerializeObject.Load(SERIAL_FILENAME.ToString());

            Validate(pop2);
        }
        public void TestPersistSerial()
        {
            BAMNetwork network = Create();

            SerializeObject.Save(SERIAL_FILENAME.ToString(), network);
            var network2 = (BAMNetwork)SerializeObject.Load(SERIAL_FILENAME.ToString());

            ValidateBAM(network2);
        }
示例#9
0
        public void testPersistSerial()
        {
            PrgPopulation pop = Create();

            Validate(pop);
            SerializeObject.Save(SERIAL_FILENAME.ToString(), pop);
            PrgPopulation pop2 = (PrgPopulation)SerializeObject.Load(SERIAL_FILENAME.ToString());

            Validate(pop2);
        }
示例#10
0
        public void TestPersistSerial()
        {
            HopfieldNetwork network = new HopfieldNetwork(4);

            network.SetWeight(1, 1, 1);

            SerializeObject.Save(SERIAL_FILENAME.ToString(), network);
            HopfieldNetwork network2 = (HopfieldNetwork)SerializeObject.Load(SERIAL_FILENAME.ToString());

            ValidateHopfield(network2);
        }
        public void TestPersistSerial()
        {
            BoltzmannMachine network = new BoltzmannMachine(4);

            network.SetWeight(1, 1, 1);
            network.Threshold[2] = 2;

            SerializeObject.Save(SERIAL_FILENAME.ToString(), network);
            BoltzmannMachine network2 = (BoltzmannMachine)SerializeObject.Load(SERIAL_FILENAME.ToString());

            ValidateHopfield(network2);
        }
            public static PAPNetworkContainer LoadPAPContainer(string pathName, string fileName)
            {
                throw new NotImplementedException();

                //Load the container
                PAPNetworkContainer returnItem = (PAPNetworkContainer)SerializeObject.Load(pathName + fileName + ".PAPc");

                //Load the network in as well
                returnItem.playerNetworkPool = new NNThreadSafeNetworkPool(NNLoadSave.loadNetwork(fileName + ".eNN", pathName), returnItem.playerId.ToString(), NNThreadSafeNetworkPool.DefaultListLength);

                return(returnItem);
            }
示例#13
0
        public static EncogNeuralNetworkSlow DeSerialize()
        {
            var fileDialog = new OpenFileDialog();

            fileDialog.Filter = "enns files (*.enns)|*.enns";
            if (fileDialog.ShowDialog() == DialogResult.OK)
            {
                var ENNetwork = new EncogNeuralNetworkSlow();
                ENNetwork.Network = (BasicNetwork)SerializeObject.Load(fileDialog.FileName);
                return(ENNetwork);
            }
            return(null);
        }
示例#14
0
        public static EncogNeuralNetworkQuick DeSerialize(int divisionCountX, int divisionCountY)
        {
            var fileDialog = new OpenFileDialog();

            fileDialog.Filter = "ennq files (*.ennq)|*.ennq";
            if (fileDialog.ShowDialog() == DialogResult.OK)
            {
                var ENNetwork = new EncogNeuralNetworkQuick();
                ENNetwork.Network         = (BasicNetwork)SerializeObject.Load(fileDialog.FileName);
                ENNetwork._divisionCountX = divisionCountX;
                ENNetwork._divisionCountY = divisionCountY;
                return(ENNetwork);
            }
            return(null);
        }
示例#15
0
        public void Execute(IExampleInterface app)
        {
            this.app = app;
            this.app = app;
            IMLDataSet   trainingSet = new BasicMLDataSet(XOR_INPUT, XOR_IDEAL);
            BasicNetwork network     = EncogUtility.SimpleFeedForward(2, 6, 0, 1, false);

            EncogUtility.TrainToError(network, trainingSet, 0.01);
            double error = network.CalculateError(trainingSet);

            SerializeObject.Save("encog.ser", network);
            network = (BasicNetwork)SerializeObject.Load("encog.ser");
            double error2 = network.CalculateError(trainingSet);

            app.WriteLine("Error before save to ser: " + Format.FormatPercent(error));
            app.WriteLine("Error before after to ser: " + Format.FormatPercent(error2));
        }
示例#16
0
        /// <summary>
        /// Loads a normalization from the specified directory and file.
        /// </summary>
        /// <param name="directory">The directory.</param>
        /// <param name="file">The file.</param>
        /// <returns>a datanormalization object</returns>
        public static DataNormalization LoadNormalization(string directory, string file)
        {
            DataNormalization norm        = null;
            FileInfo          networkFile = FileUtil.CombinePath(new FileInfo(@directory), @file);

            if (networkFile.Exists)
            {
                norm = (DataNormalization)SerializeObject.Load(networkFile.FullName);
            }

            if (norm == null)
            {
                Console.WriteLine(@"Can't find normalization resource: "
                                  + directory + file);
                return(null);
            }
            return(norm);
        }
示例#17
0
        public DataNormalization LoadNormalization()
        {
            DataNormalization norm = null;

            if (_config.NormalizeFile.Exists)
            {
                norm = (DataNormalization)SerializeObject.Load(_config.NormalizeFile.ToString());
            }

            if (norm == null)
            {
                Console.WriteLine(@"Can't find normalization resource: "
                                  + _config.NormalizeFile);
                return(null);
            }

            return(norm);
        }
 public void loadNeuralNetwork()
 {
     this.network = (FeedforwardNetwork)SerializeObject.Load("sp500.net");
 }
 public void loadNeuralNetwork()
 {
     network = (BasicNetwork)SerializeObject.Load("sp500.net");
 }