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);
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));
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