Skip to content

BUG: printed_every_n_steps and keep_every cannot be equal #6

Description

@bangxiangyong

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 :
bug

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:

growing p_w

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions