Minimal example illustrating the problem:
random Real controls(Timestep t) ~ UnivarGaussian(0, 10);
random Real state(Timestep t) ~
if t == @0 then 0
else controls(t) + state(t - 1);
obs controls(@1) = 1;
obs controls(@2) = 2;
obs controls(@3) = 3;
query state(@1); // ***
query state(@2); // ***
query state(@3);
If you run this, you get that state(@3) is a delta distribution at 6. This is the correct result.
But if you comment out the lines marked with "***", you get a completely different distribution for state(@3), which is incorrect.
This bug is a combination of laziness (don't instantiate vars that we don't need) and forgetting the past (forget all instantiated vars from timesteps smaller than the current timestep). In the example above (with the "***" lines commented out), when sampling state(@3), sample(@2) is not instantiated, and controls(@2) is already forgotten.
Current workaround: Query the state at every timestep, to make sure it is always instantiated in the current timestep.
Minimal example illustrating the problem:
If you run this, you get that
state(@3)is a delta distribution at 6. This is the correct result.But if you comment out the lines marked with "***", you get a completely different distribution for
state(@3), which is incorrect.This bug is a combination of laziness (don't instantiate vars that we don't need) and forgetting the past (forget all instantiated vars from timesteps smaller than the current timestep). In the example above (with the "***" lines commented out), when sampling
state(@3),sample(@2)is not instantiated, andcontrols(@2)is already forgotten.Current workaround: Query the state at every timestep, to make sure it is always instantiated in the current timestep.