### Question:
SyncLabelsNeuralNetUpdater extends BaseSyncNeuralNetUpdater<FeaturesLabels> { @Override public void update(FeaturesLabels featuresLabels) { current.fit(featuresLabels); syncTargetNetwork(); } SyncLabelsNeuralNetUpdater(ITrainableNeuralNet current,
                                      ITrainableNeuralNet target,
                                      NeuralNetUpdaterConfiguration configuration); @Override void update(FeaturesLabels featuresLabels);  }### Answer:
@Test public void when_callingUpdate_expect_gradientsComputedFromThreadCurrentAndAppliedOnGlobalCurrent() { NeuralNetUpdaterConfiguration configuration = NeuralNetUpdaterConfiguration.builder() .build(); SyncLabelsNeuralNetUpdater sut = new SyncLabelsNeuralNetUpdater(threadCurrentMock, targetMock, configuration); FeaturesLabels featureLabels = new FeaturesLabels(null); sut.update(featureLabels); verify(threadCurrentMock, times(1)).fit(featureLabels); verify(targetMock, never()).fit(any()); }
@Test public void when_callingUpdate_expect_targetUpdatedFromGlobalCurrentAtFrequency() { NeuralNetUpdaterConfiguration configuration = NeuralNetUpdaterConfiguration.builder() .targetUpdateFrequency(3) .build(); SyncLabelsNeuralNetUpdater sut = new SyncLabelsNeuralNetUpdater(threadCurrentMock, targetMock, configuration); FeaturesLabels featureLabels = new FeaturesLabels(null); sut.update(featureLabels); sut.update(featureLabels); sut.update(featureLabels); verify(threadCurrentMock, never()).copyFrom(any()); verify(targetMock, times(1)).copyFrom(threadCurrentMock); }