Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting keras compiled model loss function

Tags:

keras

tf.keras

Is there any way to get the compiled model loss/metrics functions from the model object?

I need this to access the loss function from within a callback, where I have access to self.model, but I can't find a way to access the compiled loss.

like image 643
Mike Avatar asked Dec 20 '25 07:12

Mike


1 Answers

In tensorflow 2.4, model.compiled_loss._losses returns the name of the loss function.

like image 84
Anas BELFADIL Avatar answered Dec 24 '25 11:12

Anas BELFADIL



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!