← Về thư mục
skills/pytorch-lightning/scripts/template_datamodule.py
- CustomDataset · class · L13-L59 — class CustomDataset(Dataset)
- init · method · L20-L37 — def init(self, data_path, transform=None)
- len · method · L39-L41 — def len(self)
- getitem · method · L43-L59 — def getitem(self, idx)
- TemplateDataModule · class · L62-L298 — class TemplateDataModule(L.LightningDataModule)
- init · method · L79-L96 — def init( self, data_dir: str = "./data", batch_size: int = 32, num_workers: int = 4, train_val_split: float = 0.8, pin_memory: bool = True, )
- prepare_data · method · L98-L118 — def prepare_data(self)
- setup · method · L120-L165 — def setup(self, stage: str = None)
- _get_train_transforms · method · L167-L183 — def _get_train_transforms(self)
- _get_test_transforms · method · L185-L199 — def _get_test_transforms(self)
- train_dataloader · method · L201-L216 — def train_dataloader(self)
- val_dataloader · method · L218-L232 — def val_dataloader(self)
- test_dataloader · method · L234-L246 — def test_dataloader(self)
- predict_dataloader · method · L248-L260 — def predict_dataloader(self)
- state_dict · method · L264-L271 — def state_dict(self)
- load_state_dict · method · L273-L280 — def load_state_dict(self, state_dict)
- teardown · method · L284-L298 — def teardown(self, stage: str = None)