You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
from keras import layers as kl
from keras import regularizers as kr
kl.Dense(units=16, kernel_regularizer=kr.l2(), activity_regularizer = kr.l2()).get_config().get("activity_regularizer") # evaluates to None
kl.Dense(units=16, kernel_regularizer=kr.l2(), activity_regularizer = kr.l2()).get_config().get("kernel_regularizer") # evaluates to a dict as expected
Noticed this issue when I saw that if you save a model in .keras format and load it again, it is missing activity_regularizer.
Let me know if this is by design/actvity_regularizer is deprecated/etc.
The text was updated successfully, but these errors were encountered:
I have a broader question - Based on this - https://keras.io/api/models/model_saving_apis/ I assume I should be able to save a partially trained model using model.save(), then load it using load_model(), and resume training. Note that the document does not explicitly say that.
If my assumption is true, then there are other issues: for e.g., for a trained model with a (non-custom) Loss, model.get_config().get("losses") and model.get_config.get("loss") both return None. Whereas model.losses and model.loss work as expected. Consequently, those properties don't roundtrip via save() and load_model().
simple to repro:
from keras import layers as kl
from keras import regularizers as kr
kl.Dense(units=16, kernel_regularizer=kr.l2(), activity_regularizer = kr.l2()).get_config().get("activity_regularizer") # evaluates to None
kl.Dense(units=16, kernel_regularizer=kr.l2(), activity_regularizer = kr.l2()).get_config().get("kernel_regularizer") # evaluates to a dict as expected
Noticed this issue when I saw that if you save a model in .keras format and load it again, it is missing activity_regularizer.
Let me know if this is by design/actvity_regularizer is deprecated/etc.
The text was updated successfully, but these errors were encountered: