Exemplo n.º 1
0
        public static void TrainElmhanNetwork(ref IExampleInterface app)
        {
            BasicMLDataSet set = CreateEval.CreateEvaluationSetAndLoad(app.Args[1], CONFIG.STARTING_YEAR,
                                                                       CONFIG.TRAIN_END,
                                                                       CONFIG.INPUT_WINDOW,
                                                                       CONFIG.PREDICT_WINDOW);

            //create our network.
            BasicNetwork network =
                (BasicNetwork)CreateEval.CreateElmanNetwork(CONFIG.INPUT_WINDOW, CONFIG.PREDICT_WINDOW);

            //Train it..

            double LastError = CreateEval.TrainNetworks(network, set);

            Console.WriteLine("NetWork Trained to :" + LastError);
            SuperUtils.SaveTraining(CONFIG.DIRECTORY, CONFIG.TRAINING_FILE, set);
            SuperUtils.SaveNetwork(CONFIG.DIRECTORY, CONFIG.NETWORK_FILE, network);
            Console.WriteLine("Network Saved to :" + CONFIG.DIRECTORY + " File Named :" +
                              CONFIG.NETWORK_FILE);

            Console.WriteLine("Training Saved to :" + CONFIG.DIRECTORY + " File Named :" +
                              CONFIG.TRAINING_FILE);
            MakeAPause();
        }
Exemplo n.º 2
0
        public static void TrainSVMNetwork(ref IExampleInterface app)
        {
            //BasicMLDataSet set = CreateEval.CreateEvaluationSetAndLoad(app.Args[1],1000,500,CONFIG.INPUT_WINDOW,CONFIG.PREDICT_WINDOW);

            TemporalMLDataSet Tempo = CreateEval.GenerateATemporalSet(app.Args[1], 1000, 500, CONFIG.INPUT_WINDOW, CONFIG.PREDICT_WINDOW);

            SupportVectorMachine machine = createNetwork();

            //Train it..
            double error = TrainNetworks(machine, Tempo);

            Console.WriteLine(@"SVM NetWork Trained to :" + error);
            SuperUtils.SaveTraining(CONFIG.DIRECTORY, CONFIG.SVMTRAINING_FILE, Tempo);
            SuperUtils.SaveNetwork(CONFIG.DIRECTORY, CONFIG.SVMNETWORK_FILE, machine);

            Console.WriteLine(@"Network Saved to :" + CONFIG.DIRECTORY + @" File Named :" +
                              CONFIG.SVMNETWORK_FILE);
            Console.WriteLine(@"Training Saved to :" + CONFIG.DIRECTORY + @" File Named :" +
                              CONFIG.SVMTRAINING_FILE);
            MakeAPause();
        }