-
Notifications
You must be signed in to change notification settings - Fork 1
Latent space #2
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
base: main
Are you sure you want to change the base?
Latent space #2
Conversation
gwaybio
left a comment
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 couple comments (mostly about hardcoding, and one about duplicating functions) that should be addressed prior to merging.
latent_space/main_latent.py
Outdated
| for t in range(9): | ||
| z = tdvae.forward(images, t) | ||
| z_values.append(z.cpu().detach().numpy()) | ||
| # print(np.array(z_values).shape) |
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.
it's best to remove debugging lines prior to merging
latent_space/main_latent.py
Outdated
| for i in range(9): | ||
| for j in range(2): | ||
| for k in range(16): |
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.
Why are these values hardcoded? Are there constants defined above that you could use instead?
latent_space/main_latent.py
Outdated
| for i in range(9): | ||
| for j in range(2): | ||
| for k in range(16): | ||
| # frame1 = z_values[i][0] |
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.
debug line?
latent_space/main_latent.py
Outdated
|
|
||
|
|
||
| z_df = pd.DataFrame(columns=["x", "y", "z", "vid"]) | ||
| for i in range(9): |
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 recommend naming these iterators to be more descriptive? What does i, j, and k stand for? The answers to this question should be the variable name :)
| ax = fig.add_subplot(projection="3d") | ||
|
|
||
| colors = {0: "orange", 1: "g"} | ||
| for i in range(2): |
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.
avoid hardcoding the number 2 here. Is there a variable that can replace?
latent_space/model_latent.py
Outdated
| @@ -0,0 +1,380 @@ | |||
| __author__ = "Keenan Manpearl" | |||
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'm a bit confused why you need this script? Doesn't it exist somewhere else in this repo? Would it be possible to import from there (instead of, presumably, duplicating the code)?
I created the scripts in the latent_space folder to extract the z dimensions from the model.
main_latentis a modified version ofmain_train.model_latentis a version ofmodelthat has been edited to create z values for every time point, not just t2.