Skip to content
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

Explicit target shape argument in the HCS data module #212

Merged
merged 3 commits into from
Nov 27, 2024

Conversation

ziw-liu
Copy link
Collaborator

@ziw-liu ziw-liu commented Nov 21, 2024

Replace the architecture argument with explicit targe_2d to avoid confusion. Also changed the default to False since 2.5D is no longer used in production.

Previously, if architecture is not specified, it will default to '2.5D' and produce incorrect results for 3D models, where the output would have 1 Z-window worth of extra blank slices relative to the input. This was not a problem before #182, when this argument was hard-linked by the CLI with the model configuration.

@tayllatheodoro @Soorya19Pradeep @ieivanov @talonchandler:
This parameter used to be automatically configured (correctly) for viscy<=0.2.1, which is all the stable versions on PyPI. If you recently did 3D predictions with a pre-release installation, please check the results to make sure that the configuration is correct (look for blank slices at the start of z-stacks). Specifically for @tayllatheodoro I noticed that some of the mantis predictions was affected by this.

@ziw-liu ziw-liu added breaking Breaking changes translation Image translation (VS) labels Nov 21, 2024
@ziw-liu ziw-liu requested a review from edyoshikun November 21, 2024 23:00
@ziw-liu ziw-liu added this to the v0.3.0 milestone Nov 21, 2024
@ziw-liu ziw-liu marked this pull request as ready for review November 21, 2024 23:16
Copy link
Contributor

@edyoshikun edyoshikun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! ship it 🚀

@edyoshikun edyoshikun merged commit baa2b83 into main Nov 27, 2024
4 checks passed
@edyoshikun edyoshikun deleted the hcs-target-shape branch November 27, 2024 22:01
edyoshikun pushed a commit that referenced this pull request Dec 18, 2024
* explicit target shape argument in the HCS data module

* update docstring

* update test cases
edyoshikun pushed a commit that referenced this pull request Dec 18, 2024
* explicit target shape argument in the HCS data module

* update docstring

* update test cases
edyoshikun pushed a commit that referenced this pull request Dec 19, 2024
* explicit target shape argument in the HCS data module

* update docstring

* update test cases
edyoshikun pushed a commit that referenced this pull request Dec 19, 2024
* explicit target shape argument in the HCS data module

* update docstring

* update test cases
edyoshikun added a commit that referenced this pull request Dec 21, 2024
* translation: fix validation loss aggregation (#202)

* exposing prefetch and persistent worker (#203)

* metrics for dynamic, smoothness and docstrings

* updated metrics and plots for distance

* fixed CI test cases

* nexnt loss prototype

* fix bug with z_scale_range in hcs datamodule. If the value is an int this does not work.

* exclude the negative pair from dataloader and forward pass

* adding option using pytorch-metric-learning implementation
and modifying previous to match same input args

* removing our implementation of NTXentLoss and using pytorch metric

* ruff

* prototype for phate and umap plot

* - proofreading the calculations
- removing unecessary calls to ALFI script
- simplifying code to re-use functions

* methods to rank nearest neighbors in embeddings

* example script to plot state change of a single track

* test using scaled features

* phate embeddings

* removing dataframe from the compute_phate
adding docstring

* adding phate to the prediction writer and moving it as dependency.

* changing the phate defaults in the prediction writer.

* ruff

* fixing bug in phate in predict writer

* adding code for measuring the smoothness

* cleanup to run on triplet and ntxent

* fix plots for smoothnes

* nexnt loss prototype

* exclude the negative pair from dataloader and forward pass

* adding option using pytorch-metric-learning implementation
and modifying previous to match same input args

* removing our implementation of NTXentLoss and using pytorch metric

* ruff

* remove blank line diff

* remove blank line diff

* simplying the engine

* explicit target shape argument in the HCS data module

* Revert "explicit target shape argument in the HCS data module"

This reverts commit 464d4c9.

* Explicit target shape argument in the HCS data module (#212)

* explicit target shape argument in the HCS data module

* update docstring

* update test cases

* Gradio example (#158)

* initial demo

* using the predict_step

* modifying paths to chkpt and example pngs

* updating gradio as the one on Huggingface

* adding configurable phate arguments via config

* script to recompute phate and overwrite the previous phate data

* ruff

* solving redundancies

* modularizing the smoothness

* removing redundant _fit_phate()

* ruff

---------

Co-authored-by: Ziwen Liu <[email protected]>
Co-authored-by: Alishba Imran <[email protected]>
Co-authored-by: Ziwen Liu <[email protected]>
edyoshikun added a commit that referenced this pull request Dec 23, 2024
* translation: fix validation loss aggregation (#202)

* exposing prefetch and persistent worker (#203)

* metrics for dynamic, smoothness and docstrings

* updated metrics and plots for distance

* fixed CI test cases

* nexnt loss prototype

* fix bug with z_scale_range in hcs datamodule. If the value is an int this does not work.

* exclude the negative pair from dataloader and forward pass

* adding option using pytorch-metric-learning implementation
and modifying previous to match same input args

* removing our implementation of NTXentLoss and using pytorch metric

* ruff

* prototype for phate and umap plot

* - proofreading the calculations
- removing unecessary calls to ALFI script
- simplifying code to re-use functions

* methods to rank nearest neighbors in embeddings

* example script to plot state change of a single track

* test using scaled features

* phate embeddings

* removing dataframe from the compute_phate
adding docstring

* adding phate to the prediction writer and moving it as dependency.

* changing the phate defaults in the prediction writer.

* ruff

* fixing bug in phate in predict writer

* adding code for measuring the smoothness

* cleanup to run on triplet and ntxent

* fix plots for smoothnes

* nexnt loss prototype

* exclude the negative pair from dataloader and forward pass

* adding option using pytorch-metric-learning implementation
and modifying previous to match same input args

* removing our implementation of NTXentLoss and using pytorch metric

* ruff

* remove blank line diff

* remove blank line diff

* simplying the engine

* explicit target shape argument in the HCS data module

* Revert "explicit target shape argument in the HCS data module"

This reverts commit 464d4c9.

* Explicit target shape argument in the HCS data module (#212)

* explicit target shape argument in the HCS data module

* update docstring

* update test cases

* Gradio example (#158)

* initial demo

* using the predict_step

* modifying paths to chkpt and example pngs

* updating gradio as the one on Huggingface

* adding configurable phate arguments via config

* script to recompute phate and overwrite the previous phate data

* ruff

* solving redundancies

* modularizing the smoothness

* removing redundant _fit_phate()

* ruff

---------

Co-authored-by: Ziwen Liu <[email protected]>
Co-authored-by: Alishba Imran <[email protected]>
Co-authored-by: Ziwen Liu <[email protected]>
mattersoflight pushed a commit that referenced this pull request Dec 23, 2024
* nexnt loss prototype

* fix bug with z_scale_range in hcs datamodule. If the value is an int this does not work.

* exclude the negative pair from dataloader and forward pass

* adding option using pytorch-metric-learning implementation
and modifying previous to match same input args

* removing our implementation of NTXentLoss and using pytorch metric

* ruff

* remove blank line diff

* remove blank line diff

* simplying the engine

* PHATE (#210)

* translation: fix validation loss aggregation (#202)

* exposing prefetch and persistent worker (#203)

* metrics for dynamic, smoothness and docstrings

* updated metrics and plots for distance

* fixed CI test cases

* nexnt loss prototype

* fix bug with z_scale_range in hcs datamodule. If the value is an int this does not work.

* exclude the negative pair from dataloader and forward pass

* adding option using pytorch-metric-learning implementation
and modifying previous to match same input args

* removing our implementation of NTXentLoss and using pytorch metric

* ruff

* prototype for phate and umap plot

* - proofreading the calculations
- removing unecessary calls to ALFI script
- simplifying code to re-use functions

* methods to rank nearest neighbors in embeddings

* example script to plot state change of a single track

* test using scaled features

* phate embeddings

* removing dataframe from the compute_phate
adding docstring

* adding phate to the prediction writer and moving it as dependency.

* changing the phate defaults in the prediction writer.

* ruff

* fixing bug in phate in predict writer

* adding code for measuring the smoothness

* cleanup to run on triplet and ntxent

* fix plots for smoothnes

* nexnt loss prototype

* exclude the negative pair from dataloader and forward pass

* adding option using pytorch-metric-learning implementation
and modifying previous to match same input args

* removing our implementation of NTXentLoss and using pytorch metric

* ruff

* remove blank line diff

* remove blank line diff

* simplying the engine

* explicit target shape argument in the HCS data module

* Revert "explicit target shape argument in the HCS data module"

This reverts commit 464d4c9.

* Explicit target shape argument in the HCS data module (#212)

* explicit target shape argument in the HCS data module

* update docstring

* update test cases

* Gradio example (#158)

* initial demo

* using the predict_step

* modifying paths to chkpt and example pngs

* updating gradio as the one on Huggingface

* adding configurable phate arguments via config

* script to recompute phate and overwrite the previous phate data

* ruff

* solving redundancies

* modularizing the smoothness

* removing redundant _fit_phate()

* ruff

---------

Co-authored-by: Ziwen Liu <[email protected]>
Co-authored-by: Alishba Imran <[email protected]>
Co-authored-by: Ziwen Liu <[email protected]>

* renaming cross_dissimilairy with  pairwaise_distance_matrix

---------

Co-authored-by: Ziwen Liu <[email protected]>
Co-authored-by: Alishba Imran <[email protected]>
Co-authored-by: Ziwen Liu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking Breaking changes translation Image translation (VS)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants