@Test public void when_callingPerformGradientsComputation_expect_performGradientsComputationIsCalledOnHandlers() { setup(false); FeaturesLabels featuresLabels = new FeaturesLabels(null); sut.performGradientsComputation(featuresLabels); verify(handler1, times(1)).performGradientsComputation(featuresLabels); verify(handler2, times(1)).performGradientsComputation(featuresLabels); }
@Override public void performGradientsComputation(FeaturesLabels featuresLabels) { for(INetworkHandler handler : networkHandlers) { handler.performGradientsComputation(featuresLabels); } }
CompoundNetworkHandler implements INetworkHandler { @Override public void performGradientsComputation(FeaturesLabels featuresLabels) { for(INetworkHandler handler : networkHandlers) { handler.performGradientsComputation(featuresLabels); } } }
CompoundNetworkHandler implements INetworkHandler { @Override public void performGradientsComputation(FeaturesLabels featuresLabels) { for(INetworkHandler handler : networkHandlers) { handler.performGradientsComputation(featuresLabels); } } CompoundNetworkHandler(INetworkHandler... networkHandlers); }
CompoundNetworkHandler implements INetworkHandler { @Override public void performGradientsComputation(FeaturesLabels featuresLabels) { for(INetworkHandler handler : networkHandlers) { handler.performGradientsComputation(featuresLabels); } } CompoundNetworkHandler(INetworkHandler... networkHandlers); @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); }
CompoundNetworkHandler implements INetworkHandler { @Override public void performGradientsComputation(FeaturesLabels featuresLabels) { for(INetworkHandler handler : networkHandlers) { handler.performGradientsComputation(featuresLabels); } } CompoundNetworkHandler(INetworkHandler... networkHandlers); @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);  }