@Test(expected=IllegalArgumentException.class) public void testFeedForwardWithNull(){ neuralNet.feedForward(null); }
public double[] feedForward(final double[] inputPattern) { if (inputPattern == null || inputPattern.length != netInputDim) { throw new IllegalArgumentException("Specified input pattern vector is null " + "or does not match network input dimension."); } double[] layerOutput = null; double[] layerInput = inputPattern; for (int layerIndex = 0; layerIndex < layers.size(); layerIndex++) { List<Neuron> layer = layers.get(layerIndex); int layerSize = layer.size(); layerOutput = new double[layerSize]; for (int n = 0; n < layerSize; n++) { if (layerIndex == 0) { layerOutput[n] = layer.get(n).processInput(new double[]{layerInput[n]}); } else { layerOutput[n] = layer.get(n).processInput(layerInput); } } layerInput = Arrays.copyOf(layerOutput, layerOutput.length); } currentNetOutput = Arrays.copyOf(layerOutput, layerOutput.length); return currentNetOutput; }
BasicNeuralNet implements NeuralNet, Serializable { public double[] feedForward(final double[] inputPattern) { if (inputPattern == null || inputPattern.length != netInputDim) { throw new IllegalArgumentException("Specified input pattern vector is null " + "or does not match network input dimension."); } double[] layerOutput = null; double[] layerInput = inputPattern; for (int layerIndex = 0; layerIndex < layers.size(); layerIndex++) { List<Neuron> layer = layers.get(layerIndex); int layerSize = layer.size(); layerOutput = new double[layerSize]; for (int n = 0; n < layerSize; n++) { if (layerIndex == 0) { layerOutput[n] = layer.get(n).processInput(new double[]{layerInput[n]}); } else { layerOutput[n] = layer.get(n).processInput(layerInput); } } layerInput = Arrays.copyOf(layerOutput, layerOutput.length); } currentNetOutput = Arrays.copyOf(layerOutput, layerOutput.length); return currentNetOutput; } }
BasicNeuralNet implements NeuralNet, Serializable { public double[] feedForward(final double[] inputPattern) { if (inputPattern == null || inputPattern.length != netInputDim) { throw new IllegalArgumentException("Specified input pattern vector is null " + "or does not match network input dimension."); } double[] layerOutput = null; double[] layerInput = inputPattern; for (int layerIndex = 0; layerIndex < layers.size(); layerIndex++) { List<Neuron> layer = layers.get(layerIndex); int layerSize = layer.size(); layerOutput = new double[layerSize]; for (int n = 0; n < layerSize; n++) { if (layerIndex == 0) { layerOutput[n] = layer.get(n).processInput(new double[]{layerInput[n]}); } else { layerOutput[n] = layer.get(n).processInput(layerInput); } } layerInput = Arrays.copyOf(layerOutput, layerOutput.length); } currentNetOutput = Arrays.copyOf(layerOutput, layerOutput.length); return currentNetOutput; } BasicNeuralNet(int[] netTopology, double biasInput,
            Class<? extends ActivationFunction> activationFunction, Random random); }
BasicNeuralNet implements NeuralNet, Serializable { public double[] feedForward(final double[] inputPattern) { if (inputPattern == null || inputPattern.length != netInputDim) { throw new IllegalArgumentException("Specified input pattern vector is null " + "or does not match network input dimension."); } double[] layerOutput = null; double[] layerInput = inputPattern; for (int layerIndex = 0; layerIndex < layers.size(); layerIndex++) { List<Neuron> layer = layers.get(layerIndex); int layerSize = layer.size(); layerOutput = new double[layerSize]; for (int n = 0; n < layerSize; n++) { if (layerIndex == 0) { layerOutput[n] = layer.get(n).processInput(new double[]{layerInput[n]}); } else { layerOutput[n] = layer.get(n).processInput(layerInput); } } layerInput = Arrays.copyOf(layerOutput, layerOutput.length); } currentNetOutput = Arrays.copyOf(layerOutput, layerOutput.length); return currentNetOutput; } BasicNeuralNet(int[] netTopology, double biasInput,
            Class<? extends ActivationFunction> activationFunction, Random random); List<Neuron> getLayerUnits(int layerIndex); int getLayersCount(); double[] feedForward(final double[] inputPattern); double[] getOutput(); void reset(); int getNetInputSize(); int getNetOutputSize(); }
BasicNeuralNet implements NeuralNet, Serializable { public double[] feedForward(final double[] inputPattern) { if (inputPattern == null || inputPattern.length != netInputDim) { throw new IllegalArgumentException("Specified input pattern vector is null " + "or does not match network input dimension."); } double[] layerOutput = null; double[] layerInput = inputPattern; for (int layerIndex = 0; layerIndex < layers.size(); layerIndex++) { List<Neuron> layer = layers.get(layerIndex); int layerSize = layer.size(); layerOutput = new double[layerSize]; for (int n = 0; n < layerSize; n++) { if (layerIndex == 0) { layerOutput[n] = layer.get(n).processInput(new double[]{layerInput[n]}); } else { layerOutput[n] = layer.get(n).processInput(layerInput); } } layerInput = Arrays.copyOf(layerOutput, layerOutput.length); } currentNetOutput = Arrays.copyOf(layerOutput, layerOutput.length); return currentNetOutput; } BasicNeuralNet(int[] netTopology, double biasInput,
            Class<? extends ActivationFunction> activationFunction, Random random); List<Neuron> getLayerUnits(int layerIndex); int getLayersCount(); double[] feedForward(final double[] inputPattern); double[] getOutput(); void reset(); int getNetInputSize(); int getNetOutputSize();  }