Weight Clipping in a classifier

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


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

1 Like