mirror of
https://github.com/wassname/pytorch-lightning.git
synced 2026-09-10 12:21:57 +08:00
diable val and test shuffling (#1600)
* diable val and test shuffling * diable val and test shuffling * diable val and test shuffling * diable val and test shuffling * log * condition * shuffle * refactor Co-authored-by: J. Borovec <jirka.borovec@seznam.cz>
This commit is contained in:
co-authored by
J. Borovec
parent
791ba91dec
commit
b620d86c54
@@ -3,7 +3,8 @@ from torch.utils.data import DataLoader
|
||||
from tests.base.datasets import TrialMNIST
|
||||
|
||||
|
||||
class ModelTemplateUtils:
|
||||
class ModelTemplateData:
|
||||
hparams: ...
|
||||
|
||||
def dataloader(self, train):
|
||||
dataset = TrialMNIST(root=self.hparams.data_root, train=train, download=True)
|
||||
@@ -11,10 +12,14 @@ class ModelTemplateUtils:
|
||||
loader = DataLoader(
|
||||
dataset=dataset,
|
||||
batch_size=self.hparams.batch_size,
|
||||
shuffle=True
|
||||
# test and valid shall not be shuffled
|
||||
shuffle=train,
|
||||
)
|
||||
return loader
|
||||
|
||||
|
||||
class ModelTemplateUtils:
|
||||
|
||||
def get_output_metric(self, output, name):
|
||||
if isinstance(output, dict):
|
||||
val = output[name]
|
||||
|
||||
Reference in New Issue
Block a user