TensorFlow documentation on custom loss function and adding hyperparameters?

Is there a reference in the TensorFlow documentation how to add a hyperparameter to a custom loss function?

I just checked the TF documentation and could not find something explaining the part with the wrapper function to the loss in order to add a hyperparameter.

I am referring to the first Lab in week2.


1 Like

You could read the article in this link:


But it is very similar to what is explained in lab 1 and lab 2 of the first week of the course.

Probably the prefered way of doing things is what is presented in last part of lab 2 of week 1. Creating a sub-class (MyHuberLoss) of the super class Loss and changing the relevant parts inside this newly created class (as shown in the notebook) in order for the objects of the newly created class of loss to accept hyperparameters.