tensorflow / java

Java bindings for TensorFlow
Apache License 2.0
813 stars 200 forks source link

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

Open Dong148 opened 6 months ago

Dong148 commented 6 months ago

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

THANKS FOR HELP

Craigacp commented 6 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.