diff options
author | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2021-04-07 22:12:10 +0200 |
---|---|---|
committer | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2021-04-07 22:12:10 +0200 |
commit | 8afa8e1c6e9623b0dea86236da04b2b4173e9443 (patch) | |
tree | 4c9462507b3b3076aa26f08ab629f64b90aed2cb /text_recognizer/models/transformer.py | |
parent | 33190bc9c0c377edab280efe4b0bd0e53bb6cb00 (diff) |
Fixed typing and typos, train script load config, reformatted
Diffstat (limited to 'text_recognizer/models/transformer.py')
-rw-r--r-- | text_recognizer/models/transformer.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/text_recognizer/models/transformer.py b/text_recognizer/models/transformer.py index 983e274..b23685b 100644 --- a/text_recognizer/models/transformer.py +++ b/text_recognizer/models/transformer.py @@ -1,7 +1,7 @@ """PyTorch Lightning model for base Transformers.""" from typing import Dict, List, Optional, Union, Tuple -from omegaconf import OmegaConf +from omegaconf import DictConfig, OmegaConf import pytorch_lightning as pl import torch from torch import nn @@ -20,9 +20,9 @@ class LitTransformerModel(LitBaseModel): def __init__( self, network: Type[nn, Module], - optimizer: Union[OmegaConf, Dict], - lr_scheduler: Union[OmegaConf, Dict], - criterion: Union[OmegaConf, Dict], + optimizer: Union[DictConfig, Dict], + lr_scheduler: Union[DictConfig, Dict], + criterion: Union[DictConfig, Dict], monitor: str = "val_loss", mapping: Optional[List[str]] = None, ) -> None: |