diff --git a/README.txt b/README.txt index 4472474..3259c28 100644 --- a/README.txt +++ b/README.txt @@ -4,6 +4,7 @@ however, feel free to copy any snippets of code you find useful. TODOs: (that i can remember right now) - normalize `for i=a,b` code style +- count decisions made onscreen instead of partial frame count? - normalize and/or embed sprite type inputs - settle on a network architecture - compute how many input neurons the network needs instead of hardcoding diff --git a/main.lua b/main.lua index 3104ddc..83ec759 100644 --- a/main.lua +++ b/main.lua @@ -276,8 +276,10 @@ local function learn_from_epoch() base_params = es:params() - for i, v in ipairs(base_params) do - base_params[i] = v * (1 - cfg.weight_decay) + if cfg.weight_decay > 0 then + for i, v in ipairs(base_params) do + base_params[i] = v * (1 - cfg.weight_decay) + end end es:params(base_params)