@Test public void testProcessInput(){ Arrays.fill(neuron.getWeights(), WEIGHTS_VALUE_FOR_PROCESS); double result = neuron.processInput(INPUT_PATTERN_TO_PROCESS); assertEquals("Output of neuron is not as expected.", EXPECTED_OUT_FROM_PROCESS, result, DOUBLES_EQUAL_DELTA); }
public double processInput(final double[] inputs) { if (inputs == null) { throw new IllegalArgumentException("The input pattern for processing is null."); } if (inputs.length != inputDim) { throw new IllegalArgumentException("The dimension of input pattern vector " + "does not match dimenstion of the neuron."); } neuronInput = 0; for (int i = 0; i < inputDim; i++) { neuronInput += inputWeights[i] * inputs[i]; } neuronInput += inputWeights[inputDim] * biasInput; neuronOutput = function.activate(neuronInput); return neuronOutput; }
Neuron implements Serializable { public double processInput(final double[] inputs) { if (inputs == null) { throw new IllegalArgumentException("The input pattern for processing is null."); } if (inputs.length != inputDim) { throw new IllegalArgumentException("The dimension of input pattern vector " + "does not match dimenstion of the neuron."); } neuronInput = 0; for (int i = 0; i < inputDim; i++) { neuronInput += inputWeights[i] * inputs[i]; } neuronInput += inputWeights[inputDim] * biasInput; neuronOutput = function.activate(neuronInput); return neuronOutput; } }
Neuron implements Serializable { public double processInput(final double[] inputs) { if (inputs == null) { throw new IllegalArgumentException("The input pattern for processing is null."); } if (inputs.length != inputDim) { throw new IllegalArgumentException("The dimension of input pattern vector " + "does not match dimenstion of the neuron."); } neuronInput = 0; for (int i = 0; i < inputDim; i++) { neuronInput += inputWeights[i] * inputs[i]; } neuronInput += inputWeights[inputDim] * biasInput; neuronOutput = function.activate(neuronInput); return neuronOutput; } Neuron(final ActivationFunction function, int inputDim, double biasValue);  Neuron(final ActivationFunction function, int inputDim, double biasValue, final Random random);  Neuron(final ActivationFunction function, int inputDim, double biasValue, final Collection<Neuron> nextNeurons); }
Neuron implements Serializable { public double processInput(final double[] inputs) { if (inputs == null) { throw new IllegalArgumentException("The input pattern for processing is null."); } if (inputs.length != inputDim) { throw new IllegalArgumentException("The dimension of input pattern vector " + "does not match dimenstion of the neuron."); } neuronInput = 0; for (int i = 0; i < inputDim; i++) { neuronInput += inputWeights[i] * inputs[i]; } neuronInput += inputWeights[inputDim] * biasInput; neuronOutput = function.activate(neuronInput); return neuronOutput; } Neuron(final ActivationFunction function, int inputDim, double biasValue);  Neuron(final ActivationFunction function, int inputDim, double biasValue, final Random random);  Neuron(final ActivationFunction function, int inputDim, double biasValue, final Collection<Neuron> nextNeurons); ActivationFunction getActivationFunction(); double[] getWeights(); double getError(); void setError(double error); double[] getDeltas(); double processInput(final double[] inputs); double getOutput(); double getNeuronInput(); double getBiasInput(); boolean addNeuron(Neuron neuron); boolean addAllNeurons(Collection<Neuron> neurons); boolean removeNeuron(Neuron neuron); void reset(); }
Neuron implements Serializable { public double processInput(final double[] inputs) { if (inputs == null) { throw new IllegalArgumentException("The input pattern for processing is null."); } if (inputs.length != inputDim) { throw new IllegalArgumentException("The dimension of input pattern vector " + "does not match dimenstion of the neuron."); } neuronInput = 0; for (int i = 0; i < inputDim; i++) { neuronInput += inputWeights[i] * inputs[i]; } neuronInput += inputWeights[inputDim] * biasInput; neuronOutput = function.activate(neuronInput); return neuronOutput; } Neuron(final ActivationFunction function, int inputDim, double biasValue);  Neuron(final ActivationFunction function, int inputDim, double biasValue, final Random random);  Neuron(final ActivationFunction function, int inputDim, double biasValue, final Collection<Neuron> nextNeurons); ActivationFunction getActivationFunction(); double[] getWeights(); double getError(); void setError(double error); double[] getDeltas(); double processInput(final double[] inputs); double getOutput(); double getNeuronInput(); double getBiasInput(); boolean addNeuron(Neuron neuron); boolean addAllNeurons(Collection<Neuron> neurons); boolean removeNeuron(Neuron neuron); void reset();  }