mirror of
https://github.com/wassname/pytorch-lightning.git
synced 2026-09-09 11:32:07 +08:00
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:
@@ -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)
|
||||
-------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user