diff --git a/main.lua b/main.lua index 0b92d01..d24d744 100644 --- a/main.lua +++ b/main.lua @@ -202,7 +202,11 @@ local function prepare_epoch() end local function load_next_trial() - if cfg.negate_trials then trial_neg = not trial_neg end + if cfg.negate_trials then + trial_neg = not trial_neg + else + trial_neg = true + end trial_i = trial_i + 1 if trial_i == 0 and not cfg.unperturbed_trial then trial_i = 1 diff --git a/nn.lua b/nn.lua index 467bc2a..82dea0b 100644 --- a/nn.lua +++ b/nn.lua @@ -743,6 +743,7 @@ end function Model:distribute(W) -- inverse operation of collect(). + assert(W ~= nil) local i = 0 for _, node in ipairs(self.nodes) do for _, w in ipairs(node.weights) do