From faac6461d3482204898ad97f811f58889cc37e1d Mon Sep 17 00:00:00 2001 From: Francois Fleuret Date: Mon, 19 Jun 2017 18:26:17 +0200 Subject: [PATCH] Bug fix. Ouch, that was bad. --- svrtset.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/svrtset.py b/svrtset.py index 49f3279..8bfdde1 100755 --- a/svrtset.py +++ b/svrtset.py @@ -48,10 +48,11 @@ class VignetteSet: raise self.cuda = cuda - self.batch_size = batch_size self.problem_number = problem_number - self.nb_batches = nb_samples // batch_size - self.nb_samples = self.nb_batches * self.batch_size + + self.batch_size = batch_size + self.nb_samples = nb_samples + self.nb_batches = self.nb_samples // self.batch_size seeds = torch.LongTensor(self.nb_batches).random_() mp_args = [] @@ -96,10 +97,12 @@ class CompressedVignetteSet: raise self.cuda = cuda - self.batch_size = batch_size self.problem_number = problem_number - self.nb_batches = nb_samples // batch_size - self.nb_samples = self.nb_batches * self.batch_size + + self.batch_size = batch_size + self.nb_samples = nb_samples + self.nb_batches = self.nb_samples // self.batch_size + self.targets = [] self.input_storages = [] -- 2.39.5