- Notifications
You must be signed in to change notification settings - Fork 290
Add tf.keras model implementation #27
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
Merged
Merged
Conversation
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
…mpl at word2vec.py; use common model base
…reader.dataset directly to model.fit() instead of using reader.dataset.iterator; rename "Model" ==> "Code2VecModel"; use common.SpecialDictWords in keras_model and reader; fix tensorflow.*python*.keras imports
…al model output; PathContextReader: use abstract ModelInputTensorsFormer to be inherited by the impl.
…s for train; refactor config param names
…ve+load keras model; reader refactor
…layer to not use bias (now #trainable_params equals to orig tf model); use tf.train.AdamOptimizer() as optimizer instead keras "adam" - now training works on GPU
…lass; migrate lookup tables handling into `Vocab`
…maintain number of epochs for a model (recovered on load); model_base have no session object (keras model doesn't need it now); export compile keras model to a method; fix use of vocab size in embeddings; enhance save+load vocabularies; repeat eval reader; additional refactor
… model; impl `_get_vocab_embedding_as_np_array()` in keras model; separate embedding constants in `Config` (by vocab type)
…00; use keras CB to perform logging and evaluate during training; move arg parsing to config; fix AttentionLayer so mask will be input; use logger in classes (instead of prints)
…return None for non-relevant properties
…ave+load) using tf.compat.v1 api
…w old tf model file loads successfully
… If new params not stated explicitly the default behavior haven't changed.
anki54 pushed a commit to anki54/code2vec that referenced this pull request May 31, 2020
Add tf.keras model implementation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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.
Main changes:
tf.kerasmodule (and not the pureKeraspackage). In order to use the new addedKerasmodel, one should provide the--framework kerasargument to code2vec.py. The default framework is still the old TensorFlow model (this is the one chosen if no additional arguments are stated).tf.Datasetfor input pipeline and re-implement the reader in path_context_reader.py.loggeras output method instead ofprint(.)s.<OOV>and<PAD>special words. Use parameterSEPARATE_OOV_AND_PADin config.py to set whether to apply this option. The default isFalse(as it was used to be).What left to do:
Kerasfor 8 iterations, upload it to S3 and add the link to README.Should not break the current behavior, just added new functionalities. If new params not stated explicitly the default behavior haven't changed.