Skip to content
Snippets Groups Projects

Resolve "lr_decay should be optional"

Merged Ghost User requested to merge lukas_issue071_feat_optional-lr-decay into develop
1 file
+ 3
2
Compare changes
  • Side-by-side
  • Inline
@@ -70,11 +70,12 @@ class ModelSetup(RunEnvironment):
Set all callbacks for the training phase. Add all callbacks with the .add_callback statement. Finally, the
advanced model checkpoint is added.
"""
lr = self.data_store.get("lr_decay", scope="general.model")
lr = self.data_store.get_default("lr_decay", scope="general.model", default=None)
hist = HistoryAdvanced()
self.data_store.set("hist", hist, scope="general.model")
callbacks = CallbackHandler()
callbacks.add_callback(lr, self.callbacks_name % "lr", "lr")
if lr:
callbacks.add_callback(lr, self.callbacks_name % "lr", "lr")
callbacks.add_callback(hist, self.callbacks_name % "hist", "hist")
callbacks.create_model_checkpoint(filepath=self.checkpoint_name, verbose=1, monitor='val_loss',
save_best_only=True, mode='auto')
Loading