4950515253545556
* @param w * the length of the input layer. */ public InputLayer(final int w) { super(w + 1); add(new BiasNeuron()); setLayerType(LayerType.INPUT); }
3637383940414243
* @param w * the length of the layer */ public OutputLayer(final int w) { super(w + 1); add((IOutputNeuron) new BiasNeuron()); super.setLayerType(LayerType.OUTPUT); }
3536373839404142
* @param w * the length of this hidden layer */ public HiddenLayer(final int w) { super(w + 1); add(new BiasNeuron()); super.setLayerType(LayerType.HIDDEN); }
33343536373839
* #BiasNeuron()}. */ @Test public final void testBiasNeuron() { assertEquals( new BiasNeuron().getValue(), new OneValue()); }
41424344454647484950
/** * Test feedforward methods. */ @Test public final void testFeedForward() { BiasNeuron bn = new BiasNeuron(); bn.feedforward(null); bn.feedforward(new OneValue(), null); assertEquals(bn.getOutputValue(), 1, Constants.TEN); }
5253545556575859
/** * Test toString. */ @Test public final void testToString() { BiasNeuron bn = new BiasNeuron(); assertEquals(bn.toString(), "BN(1.0)"); }