Skip to content

Possible Memory leak #79

@isaacdevlugt

Description

@isaacdevlugt

In the gibbs sampling routine, the "requires_grad=True" flag in the weights and biases pollutes the routine. I ran into this problem in my multinomial RBM code. We never clear the gradient cache for just wanting to sample the RBM, so the loop over the number of gibbs steps builds and builds the cache. Can be fixed (I think) with just saying "with torch.no_grad():" then the gibbs sampling routine commences (bypasses any "requires_grad=True" and saving to cache I think).

But we might run into issues if we have this there because during training we need to sample the RBM of course, so I'm unsure what "with torch.no_grad():" will do during training since we actually need "requires_grad = True".

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions