Skip to content

gradient clipping #2724

Answered by laggui
wangjiawen2013 asked this question in Q&A
Jan 21, 2025 · 2 comments · 2 replies
Discussion options

You must be logged in to vote

With the GradientsParams, you can retrieve the gradients for a given ParamId (associated to a parameter tensor) with grads.get(id).

And then you can display / check the values of the grad tensor. If you want to check all values of a module, you could use a ModuleVisitor and do something similar to the optimizer adaptor I linked in my other response.

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@laggui
Comment options

Answer selected by wangjiawen2013
Comment options

You must be logged in to vote
1 reply
@wangjiawen2013
Comment options

# for free to join this conversation on GitHub. Already have an account? # to comment
Category
Q&A
Labels
None yet
2 participants