Fixed a small issue in the documentation for FeatureExtractorFreezeUnfreeze (#12049)

This commit is contained in:
Dennis Bappert 2022-02-23 14:03:34 +01:00 committed by GitHub
parent 1ef34c5ffd
commit 1026ceb86d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -57,7 +57,7 @@ class BaseFinetuning(Callback):
>>> class MyModel(pl.LightningModule):
... def configure_optimizer(self):
... # Make sure to filter the parameters based on `requires_grad`
... return Adam(filter(lambda p: p.requires_grad, self.parameters))
... return Adam(filter(lambda p: p.requires_grad, self.parameters()))
...
>>> class FeatureExtractorFreezeUnfreeze(BaseFinetuning):
... def __init__(self, unfreeze_at_epoch=10):