I have implemented a neural network using encog library as below,
MLDataSet trainingSet = new BasicMLDataSet(XOR_INPUT, XOR_IDEAL);
final Propagation train = new Backpropagation(network, trainingSet);
int epoch = 1;
do {
train.iteration();
System.out.println("Epoch #" + epoch +
" Error:" + train.getError());
epoch++;
} while (train.getError() < 0.009);
double e = network.calculateError(trainingSet);
System.out.println("Network trained to error :" + e);
System.out.println("Saving Network");
EncogDirectoryPersistence.saveObject(new File(FILENAME), network);
}
public void loadAndEvaluate(){
System.out.println("Loading Network");
BasicNetwork network = (BasicNetwork) EncogDirectoryPersistence.loadObject(new File(FILENAME));
BasicMLDataSet trainingSet = new BasicMLDataSet(XOR_INPUT,XOR_IDEAL);
double e = network.calculateError(trainingSet);
System.out.println("Loaded network's error is (should be the same as above ):" + e);
}
This outputs the error. But i want to test this with custom data and check if the output given for a set of data is a