diff options
author | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2021-04-15 22:05:24 +0200 |
---|---|---|
committer | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2021-04-15 22:05:24 +0200 |
commit | ffa4be4bf4e3758e01d52a9c1f354a05a90b93de (patch) | |
tree | 33a0f51f60cb181ffc562b562a7d09fcc70c5cf5 /text_recognizer/models/base.py | |
parent | 0ab820d3595e4f17d4f1f3c310e186692f65cc67 (diff) |
Created mappings
Diffstat (limited to 'text_recognizer/models/base.py')
-rw-r--r-- | text_recognizer/models/base.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/text_recognizer/models/base.py b/text_recognizer/models/base.py index c6d5d73..aeda039 100644 --- a/text_recognizer/models/base.py +++ b/text_recognizer/models/base.py @@ -49,7 +49,9 @@ class LitBaseModel(pl.LightningModule): optimizer_class = getattr(torch.optim, self._optimizer.type) return optimizer_class(params=self.parameters(), **args) - def _configure_lr_scheduler(self, optimizer: Type[torch.optim.Optimizer]) -> Dict[str, Any]: + def _configure_lr_scheduler( + self, optimizer: Type[torch.optim.Optimizer] + ) -> Dict[str, Any]: """Configures the lr scheduler.""" scheduler = {"monitor": self.monitor} args = {} or self._lr_scheduler.args @@ -59,7 +61,7 @@ class LitBaseModel(pl.LightningModule): scheduler["scheduler"] = getattr( torch.optim.lr_scheduler, self._lr_scheduler.type - )(optimizer, **args) + )(optimizer, **args) return scheduler |