-
Notifications
You must be signed in to change notification settings - Fork 138
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
Support warm-start in tfra.dynamic_embedding #221
Conversation
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). For more information, open the CLA check for this pull request. |
Hi @dakabang , please sign the CLA by following the guide, thank you! ❌ 18f7c4f PR Opener: @dakabang <zhang@yeah.net> |
tensorflow_recommenders_addons/dynamic_embedding/python/ops/warm_start_util.py
Outdated
Show resolved
Hide resolved
tensorflow_recommenders_addons/dynamic_embedding/python/ops/warm_start_util.py
Show resolved
Hide resolved
tensorflow_recommenders_addons/dynamic_embedding/python/ops/warm_start_util.py
Show resolved
Hide resolved
tensorflow_recommenders_addons/dynamic_embedding/python/kernel_tests/warm_start_util_test.py
Outdated
Show resolved
Hide resolved
tensorflow_recommenders_addons/dynamic_embedding/python/kernel_tests/warm_start_util_test.py
Show resolved
Hide resolved
save.save(sess, ckpt_prefix) | ||
|
||
with self.session(graph=ops.Graph()) as sess: | ||
embeddings = de.get_variable("embeddings", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
recommend using different name for testing different name function in one case, or you'd better to write another case.
tensorflow_recommenders_addons/dynamic_embedding/python/kernel_tests/warm_start_util_test.py
Outdated
Show resolved
Hide resolved
tensorflow_recommenders_addons/dynamic_embedding/python/ops/warm_start_util.py
Show resolved
Hide resolved
tensorflow_recommenders_addons/dynamic_embedding/python/ops/warm_start_util.py
Show resolved
Hide resolved
tensorflow_recommenders_addons/dynamic_embedding/python/ops/warm_start_util.py
Show resolved
Hide resolved
tensorflow_recommenders_addons/dynamic_embedding/python/ops/warm_start_util.py
Outdated
Show resolved
Hide resolved
tensorflow_recommenders_addons/dynamic_embedding/python/kernel_tests/warm_start_util_test.py
Show resolved
Hide resolved
8a7e109
to
52c9f63
Compare
Description
In tensorflow we use tf.train.Checkpoint(tf2) or tf.compat.v1.train.Saver(tf1) for saving/restoring model, but I found it a little hard when I use these APIs to restore part of the model in tfra to perform transfer learning. In recommendation system, it's a common trick to speed up model convergence using embedding warmup, and the dense part of the model is trained from scratch, hence partial restore. The demonstrate the API design for partial restore are as follows.
Changes