How to implement Gradient Clipping and Weight Regularization in Pyro

How to implement Gradient Clipping and Weight Regularization in Pyro. Because I experienced a gradient explosion in the process of using the Pyro training model. The usage of the documentation is very general to call the optimization algorithm, for example,
optimizer = Adam({"lr": 1e-3, "betas": (0.9, 0.999)})

1 Like

Hi @isforalan, there is a ClippedAdam optimizer implemented in Pyro for you to use.

1 Like

Thank you.:laughing: