Fix Configuring Learning Rate Schedulers (#1177)

* Update docs so users know the desired manner of configuring learning rate schedulers.

* update list

* as note

Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
This commit is contained in:
authman
2020-03-19 09:22:29 -04:00
committed by GitHub
co-authored by Jirka Borovec
parent 01b8991c5a
commit 711892a0a2
2 changed files with 30 additions and 17 deletions
+14
View File
@@ -19,6 +19,20 @@ Every optimizer you use can be paired with any `LearningRateScheduler <https://p
def configure_optimizers(self):
return [Adam(...), SGD(...)], [ReduceLROnPlateau(), LambdaLR()]
# Same as above with additional params passed to the first scheduler
def configure_optimizers(self):
optimizers = [Adam(...), SGD(...)]
schedulers = [
{
'scheduler': ReduceLROnPlateau(mode='max', patience=7),
'monitor': 'val_recall', # Default: val_loss
'interval': 'epoch',
'frequency': 1
},
LambdaLR()
]
return optimizers, schedulers
Use multiple optimizers (like GANs)
-------------------------------------