Enable newer Python versions and use of own test data#9
Open
NinaWie wants to merge 4 commits intogengchenmai:masterfrom
Open
Enable newer Python versions and use of own test data#9NinaWie wants to merge 4 commits intogengchenmai:masterfrom
NinaWie wants to merge 4 commits intogengchenmai:masterfrom
Conversation
NinaWie
commented
Nov 15, 2022
| # Save parameters | ||
| config = vars(args) | ||
| with open(os.path.join(args.model_dir, "config.json"), "w") as outfile: | ||
| json.dump(config, outfile) |
Author
There was a problem hiding this comment.
I added this in order to improve model loading, compared to the long file name with all parameters in the file name.
NinaWie
commented
Nov 15, 2022
| # random sample each context points in NeighborGraph() | ||
| self.sample_neg_pts(ng_list) | ||
|
|
||
| center_pred_embed = self.predict(ng_list) |
Author
There was a problem hiding this comment.
In this file, I added a predict function for each model, which only embeds the point itself and not the positive and negative points. The predict function is then used in the forward functions. This looks like a lot of changes but it's mainly encapsulation of the center_pred_embed part
NinaWie
commented
Nov 15, 2022
| return args_combine | ||
|
|
||
|
|
||
| def make_enc_dec(args, pointset=None, feature_embedding= None): |
Author
There was a problem hiding this comment.
This is not new code; it's only an encapsulation of code that was previously part of the __init__ of the Trainer class. In the new version, it is a separate function, and can be used in the test.py script.
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
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.
Hi, thanks for providing this nice codebase! I am using it for an own project, and I did some modifications to the code in order to run it with later Python versions, and in order to use my own data. Maybe you want to consider merging my new version into your repository :) Here's a summary of the changes
Settoset,cPickletopickle, andxrangetorangeto enable Python 3 (I'm using 3.9.5)Trainerclass and to themodel.pyfile. Maybe I overlooked some other option to do this; please let me know if that changes are redundant.