@Test public void when_callingApplyGradients_expect_handlerAppliesGradientAndIsNotified() { setup(false); Gradients gradientsMock = mock(Gradients.class); when(gradientsMock.getBatchSize()).thenReturn(12L); sut.applyGradients(gradientsMock); verify(handlerMock, times(1)).applyGradient(gradientsMock, 12L); verify(handlerMock, times(1)).notifyIterationDone(); }
@Override public void applyGradients(Gradients gradients) { invalidateCache(); networkHandler.applyGradient(gradients, gradients.getBatchSize()); networkHandler.notifyIterationDone(); }
BaseNetwork implements ITrainableNeuralNet<NET_TYPE> { @Override public void applyGradients(Gradients gradients) { invalidateCache(); networkHandler.applyGradient(gradients, gradients.getBatchSize()); networkHandler.notifyIterationDone(); } }
BaseNetwork implements ITrainableNeuralNet<NET_TYPE> { @Override public void applyGradients(Gradients gradients) { invalidateCache(); networkHandler.applyGradient(gradients, gradients.getBatchSize()); networkHandler.notifyIterationDone(); } protected  BaseNetwork(INetworkHandler networkHandler); }
BaseNetwork implements ITrainableNeuralNet<NET_TYPE> { @Override public void applyGradients(Gradients gradients) { invalidateCache(); networkHandler.applyGradient(gradients, gradients.getBatchSize()); networkHandler.notifyIterationDone(); } protected  BaseNetwork(INetworkHandler networkHandler); boolean isRecurrent(); @Override void fit(FeaturesLabels featuresLabels); @Override Gradients computeGradients(FeaturesLabels featuresLabels); @Override void applyGradients(Gradients gradients); @Override NeuralNetOutput output(Observation observation); NeuralNetOutput output(INDArray batch); @Override void reset(); void copyFrom(BaseNetwork from); abstract NET_TYPE clone(); }
BaseNetwork implements ITrainableNeuralNet<NET_TYPE> { @Override public void applyGradients(Gradients gradients) { invalidateCache(); networkHandler.applyGradient(gradients, gradients.getBatchSize()); networkHandler.notifyIterationDone(); } protected  BaseNetwork(INetworkHandler networkHandler); boolean isRecurrent(); @Override void fit(FeaturesLabels featuresLabels); @Override Gradients computeGradients(FeaturesLabels featuresLabels); @Override void applyGradients(Gradients gradients); @Override NeuralNetOutput output(Observation observation); NeuralNetOutput output(INDArray batch); @Override void reset(); void copyFrom(BaseNetwork from); abstract NET_TYPE clone();  }