base timed inputs on start of trial time

This commit is contained in:
Connor Olding 2018-05-07 16:20:59 +02:00
parent 3e7aeb3c91
commit 946f05bd3e

View file

@ -856,6 +856,7 @@ local function do_reset()
jp = nil
screen_scroll_delta = 0
trial_frames = 0
emu.frameadvance() -- prevents emulator from quirking up.
load_next_trial()
@ -942,7 +943,7 @@ local function doit(dummy)
if cfg.time_inputs then
for i=2,5 do
local v = band(total_frames, lshift(1, i)) == 0 and -256 or 256
local v = band(trial_frames, lshift(1, i)) == 0 and -256 or 256
insert(extra_input, v)
end
end
@ -1001,6 +1002,7 @@ local function doit(dummy)
nn.reshape(X, 1, gcfg.input_size)
nn.reshape(tile_input, 1, gcfg.tile_count)
trial_frames = trial_frames + cfg.frameskip
if cfg.enable_network and get_state() == 'playing' or ingame_paused then
total_frames = total_frames + cfg.frameskip