// create input layer neuron settings for this network
NeuronProperties inNeuronProperties = new NeuronProperties();
inNeuronProperties.setProperty("transferFunction", TransferFunctionType.LINEAR);
// createLayer input layer with specified number of neurons
Layer inputLayer = LayerFactory.createLayer(inputNeuronsCount, inNeuronProperties);
inputLayer.addNeuron(new BiasNeuron()); // add bias neuron (always 1, and it will act as bias input for output neuron)
this.addLayer(inputLayer);
// create output layer neuron settings for this network
NeuronProperties outNeuronProperties = new NeuronProperties();
outNeuronProperties.setProperty("transferFunction", TransferFunctionType.RAMP);
outNeuronProperties.setProperty("transferFunction.slope", new Double(1));
outNeuronProperties.setProperty("transferFunction.yHigh", new Double(1));
outNeuronProperties.setProperty("transferFunction.xHigh", new Double(1));
outNeuronProperties.setProperty("transferFunction.yLow", new Double(-1));
outNeuronProperties.setProperty("transferFunction.xLow", new Double(-1));
// createLayer output layer (only one neuron)
Layer outputLayer = LayerFactory.createLayer(1, outNeuronProperties);
this.addLayer(outputLayer);
// createLayer full conectivity between input and output layer
ConnectionFactory.fullConnect(inputLayer, outputLayer);