diff --git a/xnes.lua b/xnes.lua index caa20a1..b54179f 100644 --- a/xnes.lua +++ b/xnes.lua @@ -179,12 +179,12 @@ function Xnes:tell(scored, noise) -- finally, update according to the gradients. + local dotted = dot_mv(self.covars, g_delta) local step = {} for i, v in ipairs(dotted) do step[i] = self.sigma * v end - local dotted = dot_mv(self.covars, g_delta) for i, v in ipairs(self.mean) do self.mean[i] = v + self.mean_adapt * step[i] end