This commit is contained in:
Connor Olding 2018-06-14 22:40:52 +02:00
parent f512f8ac3a
commit 33eeaf9c76

View file

@ -68,10 +68,6 @@ function Xnes:init(dims, popsize, learning_rate, sigma, antithetic)
-- you can imagine the "s" standing for "sqrt" if you like.
self.covars = make_covars(self.dims, self.sigma, self.covars)
--self.log_sigma = log(self.sigma)
--self.log_covars = zeros{dims, dims}
--for i, v in ipairs(self.covars) do self.log_covars[i] = log(v) end
self.mean_adapt = 1.0
end
@ -189,13 +185,6 @@ function Xnes:tell(scored, noise)
self.mean[i] = v + self.mean_adapt * step[i]
end
--[[
--self.log_sigma = self.log_sigma + self.learning_rate / 2 * g_sigma
for i, v in ipairs(self.log_covars) do
self.log_covars[i] = v + lr * g_covars[i]
end
--]]
local lr = self.learning_rate * 0.5
self.sigma = self.sigma * exp(lr * g_sigma)
for i, v in ipairs(self.covars) do
@ -203,8 +192,6 @@ function Xnes:tell(scored, noise)
end
-- bookkeeping:
--self.sigma = exp(self.log_sigma)
--for i, v in ipairs(self.log_covars) do self.covars[i] = exp(v) end
self.noise = nil
return step