pybnn
pybnn copied to clipboard
BUG: printed_every_n_steps and keep_every cannot be equal
When print_every_n_steps
and keep_every
are set to equal, the network is not updated properly
Following the notebook example:
model = Bohamiann(print_every_n_steps=50)
model.train(x[:, None], y, num_steps=20000, num_burn_in_steps=2000, keep_every=50, lr=1e-2, verbose=True)
results in :
The reason is because the seemingly innocent print_every_n_steps
does an important job in the background : by calling network_predict
, implicitly the current weights is reset to the latest sampled_weights via the line : self.network_weights = weights
Upon removing the line where it prints
the network performance, we can log and notice the drifting loss weights prior shown as WP
here:
good catch thanks, could you send a PR to fix it?
I don't know how to fix it unfortunately !..