keras-team / keras-nlp

Modular Natural Language Processing workflows with Keras
Apache License 2.0
734 stars 216 forks source link

Retrieving Model Text in Custom Loss Function for Training #1589

Open mostafamdy opened 2 months ago

mostafamdy commented 2 months ago

Hi,

Is it possible to design a custom loss function that retrieves the model's predicted text during training? Based on this predicted text, I'd like to perform calculations to influence the loss value.