trainingSet.addElement(new SupervisedTrainingElement(new double[]{1, 1}, new double[]{1}));
// create perceptron neural network
NeuralNetwork myPerceptron = new Perceptron(2, 1);
// learn the training set
myPerceptron.learnInSameThread(trainingSet);
// test perceptron
System.out.println("Testing trained perceptron");
testNeuralNetwork(myPerceptron, trainingSet);
// save trained perceptron
myPerceptron.save("mySamplePerceptron.nnet");