Yes, you’re right, that was a stupid question. Of course the dataset is fine . I have captured that data, but nothing seems unreasonable, at least from just visual inspection. Is there a way to, just given the previous data, compute the gradient? (so I can inspect individually each step that is taken).
Also, something that is bugging me is that, when I do contrastive divergence during several steps, I am not sure whether the computation tree that does the backpropagation is extended. Is there a way of visualizing this?
Also I am tempted to substitute the line
train_op.step()

by
for p in rbm.parameters():
    p.data.add_(-learning_rate, p.grad.data)

This seems to delay the appearance of the error, but it does not prevent it from happening. I’m also trying to see now if the nature of the error is the same.