@Test public void when_callingNotifyGradientCalculation_expect_listenersNotified() { setup(false); final Collection<TrainingListener> listeners = new ArrayList<TrainingListener>() {{ add(trainingListenerMock); }}; when(modelMock.getListeners()).thenReturn(listeners); sut.notifyGradientCalculation(); verify(trainingListenerMock, times(1)).onGradientCalculation(modelMock); }
@Override public void notifyGradientCalculation() { Iterable<TrainingListener> listeners = model.getListeners(); if (listeners != null) { for (TrainingListener l : listeners) { l.onGradientCalculation(model); } } }
ComputationGraphHandler implements INetworkHandler { @Override public void notifyGradientCalculation() { Iterable<TrainingListener> listeners = model.getListeners(); if (listeners != null) { for (TrainingListener l : listeners) { l.onGradientCalculation(model); } } } }
ComputationGraphHandler implements INetworkHandler { @Override public void notifyGradientCalculation() { Iterable<TrainingListener> listeners = model.getListeners(); if (listeners != null) { for (TrainingListener l : listeners) { l.onGradientCalculation(model); } } } ComputationGraphHandler(ComputationGraph model, String[] labelNames, String gradientName); }
ComputationGraphHandler implements INetworkHandler { @Override public void notifyGradientCalculation() { Iterable<TrainingListener> listeners = model.getListeners(); if (listeners != null) { for (TrainingListener l : listeners) { l.onGradientCalculation(model); } } } ComputationGraphHandler(ComputationGraph model, String[] labelNames, String gradientName); @Override void notifyGradientCalculation(); @Override void notifyIterationDone(); @Override void performFit(FeaturesLabels featuresLabels); @Override void performGradientsComputation(FeaturesLabels featuresLabels); @Override void fillGradientsResponse(Gradients gradients); @Override void applyGradient(Gradients gradients, long batchSize); @Override INDArray[] recurrentStepOutput(Observation observation); @Override INDArray[] batchOutput(INDArray batch); @Override void resetState(); @Override INetworkHandler clone(); @Override void copyFrom(INetworkHandler from); }
ComputationGraphHandler implements INetworkHandler { @Override public void notifyGradientCalculation() { Iterable<TrainingListener> listeners = model.getListeners(); if (listeners != null) { for (TrainingListener l : listeners) { l.onGradientCalculation(model); } } } ComputationGraphHandler(ComputationGraph model, String[] labelNames, String gradientName); @Override void notifyGradientCalculation(); @Override void notifyIterationDone(); @Override void performFit(FeaturesLabels featuresLabels); @Override void performGradientsComputation(FeaturesLabels featuresLabels); @Override void fillGradientsResponse(Gradients gradients); @Override void applyGradient(Gradients gradients, long batchSize); @Override INDArray[] recurrentStepOutput(Observation observation); @Override INDArray[] batchOutput(INDArray batch); @Override void resetState(); @Override INetworkHandler clone(); @Override void copyFrom(INetworkHandler from);  }