Hi guys,
The gradient descent part of my loop looks like this:
torch::Tensor loss = torch::nn::functional::mse_loss(guess, target);
optimizer.zero_grad();
loss.backward();
optimizer.step();

I’d like to terminate the loop when guess has stopped changing - would I just look for the size of the difference between previous guess and guess, or is there a better way?
Thanks.