From 26420733f98292639b9addb02e73fd8f12ee82e7 Mon Sep 17 00:00:00 2001 From: Jordan Gong Date: Fri, 19 Aug 2022 14:02:04 +0800 Subject: Add dependencies - Pytorch Lighting (pytorch-lighting) - Pytorch image models (timm) --- posrecon/main.py | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 posrecon/main.py (limited to 'posrecon') 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 -- cgit v1.2.3