-
Notifications
You must be signed in to change notification settings - Fork 3
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
Evaluation scripts #164
Evaluation scripts #164
Conversation
alishbaimran
commented
Sep 16, 2024
- Added scripts for generating figures for cosine similarity and UMAP/PCA
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.
@alishbaimran the logic and your plot read correctly. I am approving the merge so you can proceed. Please do the following:
- Refactor computation of consine similarity and displacement to
representation.viscy.evaluation
. - Consistently plot
cosine similarity
and not introducecosine dissimilarity
.
|
||
# %% Function to compute the norm of differences between embeddings at t and t + tau | ||
# %% Function to compute the norm of differences between embeddings at t and t + tau | ||
def compute_displacement(embedding_dataset, max_tau=10, use_cosine=True): |
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.
@alishbaimran this should be part of viscy.representation.evaluation
. All algorithms should be there. The scripts should have only paths and plotting code.
@@ -83,85 +171,11 @@ def plot_umap_infection(features, infection, title): | |||
plt.legend(loc='best') | |||
plt.title("UMAP Plot - February Dataset with Mock, Zika, and Dengue Highlighted") | |||
plt.show() | |||
======= | |||
plot_umap_histogram(feb_umap_data, feb_infection, "February Dataset") | |||
>>>>>>> Stashed changes:applications/contrastive_phenotyping/contrastive_cli/figures/figure4/figure_a_1.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.
Merge error
viscy/translation/engine.py
Outdated
@@ -68,7 +68,7 @@ def __init__( | |||
self.l2_alpha = l2_alpha | |||
self.ms_dssim_alpha = ms_dssim_alpha | |||
|
|||
@torch.amp.custom_fwd(device_type="cuda", cast_inputs=torch.float32) | |||
@torch.cuda.amp.custom_fwd(cast_inputs=torch.float32) |
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.
Unrelated diff.
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.
Test will not pass otherwise. I can revert but tests will fail.
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.
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 started the evaluation branch from the representation branch which does not have this change: https://github.com/mehta-lab/VisCy/blob/representation/viscy/translation/engine.py. How do I deal with this?
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.
Pull the base branch and rebase/merge based on your preference. Please consult Git documentation or search online.
<<<<<<< Updated upstream:applications/contrastive_phenotyping/figures/figure_4e_2_feb.py | ||
|
||
from viscy.representation.embedding_writer import read_embedding_dataset | ||
|
||
======= | ||
from pathlib import Path | ||
from viscy.representation.embedding_writer import read_embedding_dataset | ||
>>>>>>> Stashed changes:applications/contrastive_phenotyping/contrastive_cli/figures/figure4/figure_e_2_feb.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.
Merge 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.
Please fix obvious version control errors before merging.
…et contrastive task (#154) * wip: sample positive and negative samples from another time point * configure time interval in triplet data module * vectorized anchor filtering * conditional augmentation for anchor anchor is augmented if the positive is another time point * example training script for the CTC dataset this is optimized to run on MPS * add example CTC prediction config for MPS