trainingSet.addElement(new SupervisedTrainingElement(new double[]{0, 1}, new double[]{1}));
trainingSet.addElement(new SupervisedTrainingElement(new double[]{1, 0}, new double[]{1}));
trainingSet.addElement(new SupervisedTrainingElement(new double[]{1, 1}, new double[]{0}));
MultiLayerPerceptron nnet = new MultiLayerPerceptron( TransferFunctionType.TANH ,2, 3, 1);
MatrixMultiLayerPerceptron mnet = new MatrixMultiLayerPerceptron(nnet);
System.out.println("Training network...");
mnet.learnInSameThread(trainingSet);
System.out.println("Done training network.");
}