c.setConfValue("neuronType", Neuron.class);
c.setConfValue("networkType", NeuralNetwork.NetworkType.MULTI_LAYER_PERCEPTRON);
c.setConfValue("layerNeuronCounts", "2,3,1" );
MultiLayerPerceptronNetwork mlp_network = new MultiLayerPerceptronNetwork();
// mlp_network.setInputVector(vec);
int[] neurons = { 2, 3, 1 };
c.setLayerNeuronCounts( neurons );
mlp_network.buildFromConf(c);
for ( int x = 0; x < 40000; x++ ) {
mlp_network.train(v0_out, v0);
mlp_network.train(v1_out, v1);
mlp_network.train(v2_out, v2);
mlp_network.train(v3_out, v3);
int total_records = 0;
int number_correct = 0;
total_records++;
mlp_network.setInputVector( v0 );
mlp_network.calculate();
Vector networkOutput = mlp_network.getOutputVector();
System.out.println( "> out: 0 =? " + networkOutput.get(0) );
mlp_network.setInputVector( v1 );
mlp_network.calculate();
Vector networkOutput_1 = mlp_network.getOutputVector();
System.out.println( "> out: 1 =? " + networkOutput_1.get(0) );
mlp_network.setInputVector( v2 );
mlp_network.calculate();
Vector networkOutput_2 = mlp_network.getOutputVector();
System.out.println( "> out: 1 =? " + networkOutput_2.get(0) );
mlp_network.setInputVector( v3 );
mlp_network.calculate();
Vector networkOutput_3 = mlp_network.getOutputVector();
System.out.println( "> out: 0 =? " + networkOutput_3.get(0) );