You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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".
The text was updated successfully, but these errors were encountered:
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".
The text was updated successfully, but these errors were encountered: