@Test public void when_callingOnNewEpochWithoutHistoryProcessor_expect_noException() { TestTrainer trainer = new TestTrainer(); DataManagerTrainingListener sut = new DataManagerTrainingListener(new MockDataManager(false)); TrainingListener.ListenerResponse response = sut.onNewEpoch(trainer); assertEquals(TrainingListener.ListenerResponse.CONTINUE, response); }
@Override public ListenerResponse onNewEpoch(IEpochTrainer trainer) { IHistoryProcessor hp = trainer.getHistoryProcessor(); if(hp != null) { int[] shape = trainer.getMdp().getObservationSpace().getShape(); String filename = dataManager.getVideoDir() + "/video-"; if (trainer instanceof AsyncThread) { filename += ((AsyncThread) trainer).getThreadNumber() + "-"; } filename += trainer.getEpochCount() + "-" + trainer.getStepCount() + ".mp4"; hp.startMonitor(filename, shape); } return ListenerResponse.CONTINUE; }
DataManagerTrainingListener implements TrainingListener { @Override public ListenerResponse onNewEpoch(IEpochTrainer trainer) { IHistoryProcessor hp = trainer.getHistoryProcessor(); if(hp != null) { int[] shape = trainer.getMdp().getObservationSpace().getShape(); String filename = dataManager.getVideoDir() + "/video-"; if (trainer instanceof AsyncThread) { filename += ((AsyncThread) trainer).getThreadNumber() + "-"; } filename += trainer.getEpochCount() + "-" + trainer.getStepCount() + ".mp4"; hp.startMonitor(filename, shape); } return ListenerResponse.CONTINUE; } }
DataManagerTrainingListener implements TrainingListener { @Override public ListenerResponse onNewEpoch(IEpochTrainer trainer) { IHistoryProcessor hp = trainer.getHistoryProcessor(); if(hp != null) { int[] shape = trainer.getMdp().getObservationSpace().getShape(); String filename = dataManager.getVideoDir() + "/video-"; if (trainer instanceof AsyncThread) { filename += ((AsyncThread) trainer).getThreadNumber() + "-"; } filename += trainer.getEpochCount() + "-" + trainer.getStepCount() + ".mp4"; hp.startMonitor(filename, shape); } return ListenerResponse.CONTINUE; } DataManagerTrainingListener(IDataManager dataManager); }
DataManagerTrainingListener implements TrainingListener { @Override public ListenerResponse onNewEpoch(IEpochTrainer trainer) { IHistoryProcessor hp = trainer.getHistoryProcessor(); if(hp != null) { int[] shape = trainer.getMdp().getObservationSpace().getShape(); String filename = dataManager.getVideoDir() + "/video-"; if (trainer instanceof AsyncThread) { filename += ((AsyncThread) trainer).getThreadNumber() + "-"; } filename += trainer.getEpochCount() + "-" + trainer.getStepCount() + ".mp4"; hp.startMonitor(filename, shape); } return ListenerResponse.CONTINUE; } DataManagerTrainingListener(IDataManager dataManager); @Override ListenerResponse onTrainingStart(); @Override void onTrainingEnd(); @Override ListenerResponse onNewEpoch(IEpochTrainer trainer); @Override ListenerResponse onEpochTrainingResult(IEpochTrainer trainer, IDataManager.StatEntry statEntry); @Override ListenerResponse onTrainingProgress(ILearning learning); }
DataManagerTrainingListener implements TrainingListener { @Override public ListenerResponse onNewEpoch(IEpochTrainer trainer) { IHistoryProcessor hp = trainer.getHistoryProcessor(); if(hp != null) { int[] shape = trainer.getMdp().getObservationSpace().getShape(); String filename = dataManager.getVideoDir() + "/video-"; if (trainer instanceof AsyncThread) { filename += ((AsyncThread) trainer).getThreadNumber() + "-"; } filename += trainer.getEpochCount() + "-" + trainer.getStepCount() + ".mp4"; hp.startMonitor(filename, shape); } return ListenerResponse.CONTINUE; } DataManagerTrainingListener(IDataManager dataManager); @Override ListenerResponse onTrainingStart(); @Override void onTrainingEnd(); @Override ListenerResponse onNewEpoch(IEpochTrainer trainer); @Override ListenerResponse onEpochTrainingResult(IEpochTrainer trainer, IDataManager.StatEntry statEntry); @Override ListenerResponse onTrainingProgress(ILearning learning);  }