final MLDataSet trainingSet = new BasicMLDataSet(
CustomActivation.XOR_INPUT, CustomActivation.XOR_IDEAL);
// train the neural network
final MLTrain train = new ResilientPropagation(network, trainingSet);
// reset if improve is less than 1% over 5 cycles
train.addStrategy(new RequiredImprovementStrategy(5));
EncogUtility.trainToError(train, 0.01);
EncogUtility.evaluate(network, trainingSet);