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:
William Falcon
2020-04-25 16:45:20 -04:00
committed by GitHub
co-authored by J. Borovec
parent 791ba91dec
commit b620d86c54
6 changed files with 23 additions and 9 deletions
+7 -2
View File
@@ -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]