tensorflow-eager-tutorials
tensorflow-eager-tutorials copied to clipboard
How to get regularizer loss in Eager Mode?
Hi, this me again.
I have an question about reg_loss .
The total_loss should be equal to reg_loss + softmax_loss ,but I do not know how to get reg_loss .
I have configure parameter of Conv2D(kernel_regularizer= tf.keras.regularizers.l2) like this demo but when the compute the loss of this mode compute loss . loss only compute softmax_loss, where is reg_loss , and how to get it for computing gradients??
I also use tf.get_total_loss() API but I do not know useful or not?