How to apply L2 regularization to weights tensor only?


#1

Hello everyone:
Recently a paper reported that it would be better to apply L2 regularization to weights tensor only and bias should not be regularised. The implementation way I can think of is to place weights and bias tensor into two different list and use different L2 regularization hyper-parameters to these parameter list explicitly. But I found this would be very complex, Can you think of a more simple implementation?
Thank you for your advice!!!