@Test public void when_callingUpdate_expect_targetUpdatedFromCurrentAtFrequency() { NeuralNetUpdaterConfiguration configuration = NeuralNetUpdaterConfiguration.builder() .targetUpdateFrequency(3) .build(); SyncGradientsNeuralNetUpdater sut = new SyncGradientsNeuralNetUpdater(currentMock, targetMock, configuration); Gradients gradients = new Gradients(10); sut.update(gradients); sut.update(gradients); sut.update(gradients); verify(currentMock, never()).copyFrom(any()); verify(targetMock, times(1)).copyFrom(currentMock); }
@Override public void update(Gradients gradients) { current.applyGradients(gradients); syncTargetNetwork(); }
SyncGradientsNeuralNetUpdater extends BaseSyncNeuralNetUpdater<Gradients> { @Override public void update(Gradients gradients) { current.applyGradients(gradients); syncTargetNetwork(); } }
SyncGradientsNeuralNetUpdater extends BaseSyncNeuralNetUpdater<Gradients> { @Override public void update(Gradients gradients) { current.applyGradients(gradients); syncTargetNetwork(); } SyncGradientsNeuralNetUpdater(ITrainableNeuralNet current,
                                         ITrainableNeuralNet target,
                                         NeuralNetUpdaterConfiguration configuration); }
SyncGradientsNeuralNetUpdater extends BaseSyncNeuralNetUpdater<Gradients> { @Override public void update(Gradients gradients) { current.applyGradients(gradients); syncTargetNetwork(); } SyncGradientsNeuralNetUpdater(ITrainableNeuralNet current,
                                         ITrainableNeuralNet target,
                                         NeuralNetUpdaterConfiguration configuration); @Override void update(Gradients gradients); }
SyncGradientsNeuralNetUpdater extends BaseSyncNeuralNetUpdater<Gradients> { @Override public void update(Gradients gradients) { current.applyGradients(gradients); syncTargetNetwork(); } SyncGradientsNeuralNetUpdater(ITrainableNeuralNet current,
                                         ITrainableNeuralNet target,
                                         NeuralNetUpdaterConfiguration configuration); @Override void update(Gradients gradients);  }