-
Notifications
You must be signed in to change notification settings - Fork 19.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
loss_weights depending on epoch number #20294
Comments
Hi @LucaSCostanzo - Can you help me with sample code where you are facing error ? |
Hi mehtamansi29,
and the training pipeline I used in a previous version of Keras:
but now it is not allowed, as I receive this message:
Of course I'm forced to define loss_weights and the callback as:
but now changing w1 and w2 have no effect on the loss_weights dict. I hope the issue is clearer now. |
Hi,
I'm trying to train a multi output nn and I need to change the weight of each loss component depending on the epoch number. In some previous versions of keras I implemented this mechanism by defining each weight of the loss_weights parameter as a K.variable() type, and changing the value with K.set_value() in an on_epoch_begin() method of a custom callback.
Now, in keras 3.4 this is not allowed, as loss_weights must be a list/dict of float, so within the callback I can't change the value in place with K.set_value(). Is there something I can do to overcome this issue?
Thanks
The text was updated successfully, but these errors were encountered: