Skip to content

Conversation

@ninpnin
Copy link
Owner

@ninpnin ninpnin commented Mar 5, 2025

TF2.16 broke the keras.optimizer.Adam class. Moreover, the matching tensorflow_probability version added tf_keras as an external dependency. In this pull request, I fix both of these.

Unfortunately these will be breaking changes for the end users, hence v2.0.0.

@ninpnin ninpnin requested a review from iscyb March 5, 2025 13:43
opt = tf.keras.optimizers.Adam(learning_rate=0.001)
opt_theta = opt.add_variable_from_reference(embedding.theta, "theta")#, initial_value=embedding.theta)
opt.build([opt_theta])
opt_theta.assign(embedding.theta)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

THis is the same as setting "initial_value=embedding.theta)" above?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the new API just doesn't support that anymore

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants