Closed thebarnable closed 1 year ago
We've deprecated backprop.py
as it was super inefficient and clunky to maintain.
I'd recommend manually doing a weight update at each time-step.
You may run into errors at first, but if you detach the state variables consistently, and re-initializing state variables using utils.reset(net)
, then it should work fine.
Fair enough, already went back to doing that. I'll close the issue then.
Description
I tried training N-MNIST using tonic with RTRL. Calling RTRL to perform an epoch immediately crashes because of an undefined variable (
K_flag
). On further inspection, RTRL calls TBPTT which crashes; the latter will always crash when time_var=True and K!=False (see below).What I Did
% minimal_example.py
Calling
python minimal_example.py
crashes with:Possible fix
This error will only happen for time-varying data (
time_var=True
). Currently, inbackprop.py::TBPTT
, the following code is run for time_var=True:In case of RTRL (or anytime K is false), we don't run into the first condition. K_flag is not initialized elsewhere, so the second if condition throws the error. Simple fix: Initialize K_flag to True at the beginning of TBPTT.