@Test public void when_callingUpdate_expect_computeAndUpdateNetwork() { List<Integer> trainingBatch = new ArrayList<Integer>() { { Integer.valueOf(1); Integer.valueOf(2); } }; final FeaturesLabels computeResult = new FeaturesLabels(null); when(updateAlgorithm.compute(any())).thenReturn(computeResult); sut.update(trainingBatch); verify(updateAlgorithm, times(1)).compute(trainingBatch); verify(updater, times(1)).update(computeResult); }
@Override public void update(List<EXPERIENCE_TYPE> trainingBatch) { RESULT_TYPE featuresLabels = updateAlgorithm.compute(trainingBatch); updater.update(featuresLabels); ++updateCount; }
UpdateRule implements IUpdateRule<EXPERIENCE_TYPE> { @Override public void update(List<EXPERIENCE_TYPE> trainingBatch) { RESULT_TYPE featuresLabels = updateAlgorithm.compute(trainingBatch); updater.update(featuresLabels); ++updateCount; } }
UpdateRule implements IUpdateRule<EXPERIENCE_TYPE> { @Override public void update(List<EXPERIENCE_TYPE> trainingBatch) { RESULT_TYPE featuresLabels = updateAlgorithm.compute(trainingBatch); updater.update(featuresLabels); ++updateCount; } UpdateRule(@NonNull IUpdateAlgorithm<RESULT_TYPE, EXPERIENCE_TYPE> updateAlgorithm,
                      @NonNull INeuralNetUpdater<RESULT_TYPE> updater); }
UpdateRule implements IUpdateRule<EXPERIENCE_TYPE> { @Override public void update(List<EXPERIENCE_TYPE> trainingBatch) { RESULT_TYPE featuresLabels = updateAlgorithm.compute(trainingBatch); updater.update(featuresLabels); ++updateCount; } UpdateRule(@NonNull IUpdateAlgorithm<RESULT_TYPE, EXPERIENCE_TYPE> updateAlgorithm,
                      @NonNull INeuralNetUpdater<RESULT_TYPE> updater); @Override void update(List<EXPERIENCE_TYPE> trainingBatch); @Override void notifyNewBatchStarted(); }
UpdateRule implements IUpdateRule<EXPERIENCE_TYPE> { @Override public void update(List<EXPERIENCE_TYPE> trainingBatch) { RESULT_TYPE featuresLabels = updateAlgorithm.compute(trainingBatch); updater.update(featuresLabels); ++updateCount; } UpdateRule(@NonNull IUpdateAlgorithm<RESULT_TYPE, EXPERIENCE_TYPE> updateAlgorithm,
                      @NonNull INeuralNetUpdater<RESULT_TYPE> updater); @Override void update(List<EXPERIENCE_TYPE> trainingBatch); @Override void notifyNewBatchStarted();  }