@Test public void when_callingResetState_expect_recurrentHandlersAreReset() { setup(true); sut.resetState(); verify(handler1, times(1)).resetState(); verify(handler2, never()).resetState(); }
@Override public void resetState() { for(INetworkHandler handler : networkHandlers) { if(handler.isRecurrent()) { handler.resetState(); } } }
CompoundNetworkHandler implements INetworkHandler { @Override public void resetState() { for(INetworkHandler handler : networkHandlers) { if(handler.isRecurrent()) { handler.resetState(); } } } }
CompoundNetworkHandler implements INetworkHandler { @Override public void resetState() { for(INetworkHandler handler : networkHandlers) { if(handler.isRecurrent()) { handler.resetState(); } } } CompoundNetworkHandler(INetworkHandler... networkHandlers); }
CompoundNetworkHandler implements INetworkHandler { @Override public void resetState() { for(INetworkHandler handler : networkHandlers) { if(handler.isRecurrent()) { handler.resetState(); } } } 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 resetState() { for(INetworkHandler handler : networkHandlers) { if(handler.isRecurrent()) { handler.resetState(); } } } 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);  }