Exemplo n.º 1
0
 def test_any_scheduler_integration(self):
     train_gen = some_data_generator(OptimizerCheckpointTest.batch_size)
     valid_gen = some_data_generator(OptimizerCheckpointTest.batch_size)
     lr_scheduler = ExponentialLR(gamma=0.01)
     checkpointer = LRSchedulerCheckpoint(lr_scheduler,
                                          self.checkpoint_filename,
                                          period=1)
     self.model.fit_generator(train_gen,
                              valid_gen,
                              epochs=OptimizerCheckpointTest.epochs,
                              steps_per_epoch=5,
                              callbacks=[checkpointer])
Exemplo n.º 2
0
 def test_exponential_lr_integration(self):
     exponential_lr = ExponentialLR(gamma=0.01)
     self._fit_with_callback_integration(exponential_lr)
Exemplo n.º 3
0
 def test_any_scheduler_checkpoints(self):
     lr_scheduler = ExponentialLR(gamma=0.01)
     checkpointer = LRSchedulerCheckpoint(lr_scheduler,
                                          self.checkpoint_filename,
                                          period=1)
     self._test_checkpointer(checkpointer, lr_scheduler)