tensorflow / java

Java bindings for TensorFlow
Apache License 2.0
831 stars 202 forks source link

Q: How to add Regularizer and Constraint effect correctly to a weight/bias variable or activity? #532

Open Dong148 opened 8 months ago

Dong148 commented 8 months ago

How to add Regularizer and Constraint effect correctly to a weight/bias variable or activity?

THANKS FOR HELP

Craigacp commented 7 months ago

You can add a regularization term the way you usually would, put an l2 penalty on the weights being large and add that to the loss function that you backprop.