Weight Clipping in a classifier

HI,
I have implemented a classifier using nn Module and it runs well,but now i want to clip it’s weight between certan value.Kindly tell me the way to do it

Hi,

See the answer from here: How to do constrained optimization in PyTorch

1 Like