Click here to Skip to main content
14,579,188 members
Rate this:
Please Sign up or sign in to vote.
See more:
I did training data by encog. now, I want to predicate some data, what I must do please?

The Code for training:

What I have tried:

public static double[][] INPUT ={
            new double[4] { 0.0, 0.0,0.1,0.1 },
            new double[4] { 0.5, 1.0,1.0,0.2 },
	    new double[4] { 0.0, 1.0,0.0,0.3 },
            new double[4] { 1.0, 1.0 ,0.0,0.3} };

        
        public static double[][] IDEAL = {                                              
            new double[1] { 0.0 }, 
            new double[1] { 1.0 }, 
            new double[1] { 0.5 }, 
            new double[1] { 1.0 } };

        
        public static void Main()
        {
            BasicNetwork network = new BasicNetwork();
            network.AddLayer(new BasicLayer(new ActivationSigmoid(), true, 2));
            network.AddLayer(new BasicLayer(new ActivationSigmoid(), true, 6));
            network.AddLayer(new BasicLayer(new ActivationSigmoid(), true, 1));
            network.Structure.FinalizeStructure();
            network.Reset();

            INeuralDataSet trainingSet = new BasicNeuralDataSet(INPUT, IDEAL);

            
            // train the neural network
            ITrain train = new ResilientPropagation(network, trainingSet);

            int epoch = 1;

            do
            {
                train.Iteration();
                Console.WriteLine("Epoch #" + epoch + " Error:" + train.Error);
                epoch++;
            } while ((epoch < 5000) && (train.Error > 0.001));

            // test the neural network
            Console.WriteLine("Neural Network Results:");
            foreach (INeuralDataPair pair in trainingSet)
            {
                INeuralData output = network.Compute(pair.Input);
                Console.WriteLine(pair.Input[0] + "," + pair.Input[1]
                        + ", actual=" + output[0] + ",ideal=" + pair.Ideal[0]);
            }


I want to predicate the data { 0.0, 0.0,0.1,0.2 }
what command I must use for predicate new data and getting the output
Posted
Updated 17-Feb-20 3:11am
Comments
Patrice T 15-Feb-20 18:34pm
   
Why don't you ask in a forum of users ?
Richard MacCutchan 16-Feb-20 3:24am
   
Probably study encog(whatever that is) a bit more.

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

Encog User Guide[^] may be your best information source about this framework and how it can/has to be used.
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100