diff options
author | Jordan Gong <jordan.gong@protonmail.com> | 2022-08-19 14:02:04 +0800 |
---|---|---|
committer | Jordan Gong <jordan.gong@protonmail.com> | 2022-08-19 14:02:04 +0800 |
commit | 26420733f98292639b9addb02e73fd8f12ee82e7 (patch) | |
tree | 971d3e5223be2261562e6ca404378aa34aaee453 /posrecon/main.py | |
parent | bff36e9337bd9493e95588b8e342431eb31184f6 (diff) |
Add dependencies
- Pytorch Lighting (pytorch-lighting)
- Pytorch image models (timm)
Diffstat (limited to 'posrecon/main.py')
-rw-r--r-- | posrecon/main.py | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/posrecon/main.py b/posrecon/main.py new file mode 100644 index 0000000..0660ea0 --- /dev/null +++ b/posrecon/main.py @@ -0,0 +1,31 @@ +from typing import Callable, Iterable + +import torch +from torch.utils.data import Dataset + +from libs.logging import Loggers +from libs.utils import Trainer, BaseConfig + + +class PosReconTrainer(Trainer): + def __init__(self, *args, **kwargs): + super(PosReconTrainer, self).__init__(*args, **kwargs) + + @staticmethod + def _prepare_dataset(dataset_config: BaseConfig.DatasetConfig) -> tuple[Dataset, Dataset]: + pass + + @staticmethod + def _init_models(dataset: str) -> Iterable[tuple[str, torch.nn.Module]]: + pass + + @staticmethod + def _configure_optimizers(models: Iterable[tuple[str, torch.nn.Module]], optim_config: BaseConfig.OptimConfig) -> \ + Iterable[tuple[str, torch.optim.Optimizer]]: + pass + + def train(self, num_iters: int, loss_fn: Callable, logger: Loggers, device: torch.device): + pass + + def eval(self, loss_fn: Callable, device: torch.device): + pass |