declearn.model.tensorflow.utils.build_keras_loss
Type-check, deserialize and/or wrap a keras loss into a Loss object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
loss |
Union[str, tf_keras.losses.Loss, CallableLoss]
|
Either a keras Loss object, the name of a keras loss, or a loss function that needs wrapping into a Loss object. |
required |
reduction |
str
|
Reduction scheme to apply on point-wise loss values. |
tf_keras.losses.Reduction.NONE
|
Returns:
Name | Type | Description |
---|---|---|
loss_obj |
tf_keras.losses.Loss
|
Loss object, configured to apply the |
Source code in declearn/model/tensorflow/utils/_loss.py
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 |
|