Repository navigation
docs: clarify save vs save_weights for TFQ models #1115
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
Closed
akhil9tiet
wants to merge
6
commits into
tensorflow:master
from
akhil9tiet:docs/899-save-vs-save-weights
Closed
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
aa6d5bc
docs: clarify save vs save_weights for TFQ models
akhil9tiet 8ad3486
ci: install pydot and graphviz for tutorial plot_model tests
akhil9tiet 8bda6f1
revert unintended URL and apostrophe changes in docs/concepts.md
akhil9tiet 4931ca9
Delete docs/concepts.md
akhil9tiet 0173e67
Rename quantum-concepts-fixed.md to concepts.md
akhil9tiet 8d7bf4e
Merge branch 'master' into docs/899-save-vs-save-weights
akhil9tiet File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A recent fix in the main branch solves the notebook test failures. You can remove the changes to this file. (BTW, this would have mixed two unrelated types of changes into one PR, which is bad practice.) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This is incorrect in multiple ways.
Using the term "custom quantum layers" here is misleading. In Keras terminology, "custom layers" refers to user-defined
tf.keras.layers.Layersubclasses.model.save()fails on TFQ's built-in layers. Referring to them as "custom quantum layers" implies that built-in TFQ layers supportmodel.save()and only user-subclassed layers fail.Stating "because full model serialization requires the layer to be reconstructable without the original Python code" describes the purpose of
model.save(), not why it fails in TFQ. It fails because TFQ layers accept non-TensorFlow objects (such ascirq.Circuitandcirq.PauliSum) in__init__and do not implement Keras'sget_config()method.The whole motivation for #899 (from #56) is that
model.save()fails with an uninformativeNotEncodableErrororNotImplementedError(mentioningget_config). This doesn't actually help the user.The file
docs/concepts.md("Quantum machine learning concepts") is a high-level conceptual overview of quantum computing, quantum data, and QML research. It contains no code snippets or Keras/TFQ API references. Dropping a#### Saving modelssubsection referencingmodel.save(),model.save_weights(), andmodel.load_weights()here does not fit the surrounding document context.