-
Notifications
You must be signed in to change notification settings - Fork 11
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
https://github.com/ziatdinovmax/pyroVED/issues/54 #55
Conversation
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.
A few comments/suggestions:
- Please add the unit tests to cover new code lines
- I suggest moving GP to a separate utility function and importing it from there. Then you just call something like gpr(*args, **kwargs).
- What is the meaning of training_data? Is it the same as the one used to train VAE? Or can it be any X? Need to explain it clearly.
- Making predictions on a z grid without any connection to input space may not be very useful. Let's add a decoder part that will show how these z-points look in the original data space.
@utkarshp1161 Any progress on this one? |
Hi Max, Was busy with qualifiers this past week. Will get on this. |
Hi Max,
wrt tests: I am getting below error when I run: pytest test/: I am thinking of adding tests similar to manifold2d test in test_model.py. Also for testing gp part I am thinking of Do you have suggestions on what to include in tests? |
EDIT: resolved: Environment was pointing to local python env rather than conda env. pytest running but below error
|
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.
Thanks for the update/revision.
Several comments:
- In ivae.py, on line 329, you seem to be overwriting the gp_iterations parameter and setting it to 1.
- In the utils/gp.py, the docstring says that you define and train a GP model, but there's no actual training.
- I suggest that the
predict_on_latent
method returns both the GP predictions and the manifold2d tensor, whole the plotting is optional. - For tests, just add a separate test for the (modified) GP utility to confirm that it runs and returns a tensor with an expected shape. Then, do the same for the predict_on_latent.
Thanks for pointing out.
Yep. Changed
Added a "plot" boolean which defaults to False. Returns GP predictions and the manifold2d tensor
Yep added. Thanks for reviewing. Please let me know further changes as necessary. |
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.
Almost there... Instead of returning z, we should be returning z_decoded, which is z passed through a trained decoder. In this particular case, we can obtain it simply as z_decoded = self.manifold2d(d, plot=False).
I'm curious if there's a specific reason you don't want to train GP inside utils/gp.py?
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.
Almost there... Instead of returning z, we should be returning z_decoded, which is z passed through a trained decoder. In this particular case, we can obtain it simply as z_decoded = self.manifold2d(d, plot=False).
I was having something else in mind, basically having the latent coordinates rather than decoded ones. Changed as per this suggestion.
I'm curious if there's a specific reason you don't want to train GP inside utils/gp.py?
Changed training to utils. Right, this way its more modular.
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.
I was having something else in mind, basically having the latent coordinates rather than decoded ones. Changed as per this suggestion.
In principle, we can have all three. Something like
return (z, z_decoded), predictions
Let me know if you would like to add this. Other than that I'm ready to merge it.
Codecov ReportAttention:
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #55 +/- ##
==========================================
- Coverage 91.60% 91.33% -0.28%
==========================================
Files 25 27 +2
Lines 1918 1996 +78
==========================================
+ Hits 1757 1823 +66
- Misses 161 173 +12
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Based on Discussion:
#53