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

Updating demo notebook for training #100

Merged
merged 43 commits into from
Jul 19, 2024
Merged

Updating demo notebook for training #100

merged 43 commits into from
Jul 19, 2024

Conversation

edyoshikun
Copy link
Contributor

This PR adds a demo notebook for the DL@MBL 2024 course.

  • Demo using UNeXt2 for 2D training and prediction
  • Scripts to make this a jupyter notebook provided by DL course TA's

@edyoshikun edyoshikun marked this pull request as draft July 4, 2024 04:52
@edyoshikun edyoshikun marked this pull request as ready for review July 5, 2024 02:10
Copy link
Contributor Author

@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.

Once we update the paths of the public.czbiohub we need to update thes paths.

@edyoshikun edyoshikun requested a review from ziw-liu July 5, 2024 02:11
@mattersoflight mattersoflight self-requested a review July 5, 2024 20:37
@ziw-liu
Copy link
Collaborator

ziw-liu commented Jul 5, 2024

@edyoshikun The hosting is back at https://public.czbiohub.org/comp.micro/viscy/. Can you update the paths?

git checkout 7c5e4c1d68e70163cf514d22c475da8ea7dc3a88 # Exercise is tested with this commit of viscy
# Find path to the environment - mamba activate doesn't work from within shell scripts.
ENV_PATH=$(conda info --envs | grep 04_image_translation | awk '{print $NF}')
git checkout main # Exercise is tested with this commit of viscy
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should probably pin a version here.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Actually this needs to be pinned after merging this PR...

examples/demo_dlmbl/setup.sh Outdated Show resolved Hide resolved
examples/demo_dlmbl/setup.sh Outdated Show resolved Hide resolved
examples/demo_dlmbl/solution.py Outdated Show resolved Hide resolved
examples/demo_dlmbl/solution.py Outdated Show resolved Hide resolved
@edyoshikun edyoshikun requested a review from ziw-liu July 9, 2024 16:53
data_path,
source_channel="Phase",
target_channel=["Membrane", "Nuclei"],
architecture="fcmae",
Copy link
Member

Choose a reason for hiding this comment

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

fcmae -> unext2

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As mentioned, we added an alias so that UNeXt2_2D == fcmae architecture to avoid introducing changes that don't allow the re-loading of weights for reproducibility. We will merge the UNeXt2 and fcmae architectures after the release.

# PyTorch uses dynamic graphs under the hood. The graphs are constructed on the fly. This is in contrast to TensorFlow, where the graph is constructed before the training loop and remains static. In other words, the graph of the network can change with every forward pass. Therefore, we need to supply an input tensor to construct the graph. The input tensor can be a random tensor of the correct shape and type. We can also supply a real image from the dataset. The latter is more useful for debugging.
# PyTorch uses dynamic graphs under the hood.
# The graphs are constructed on the fly.
# This is in contrast to TensorFlow,
Copy link
Collaborator

Choose a reason for hiding this comment

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

@ziw-liu ziw-liu added the documentation Improvements or additions to documentation label Jul 18, 2024
@ziw-liu ziw-liu requested a review from mattersoflight July 18, 2024 21:21
Copy link
Member

@mattersoflight mattersoflight left a comment

Choose a reason for hiding this comment

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

I won't be able to test the exercise before completing the work on manuscript(s). Please merge when you have confidence that all parts of the exercise can be run.


# %% tags=["solution"]

##########################
######## Solution ########
##########################
"""
Copy link
Member

Choose a reason for hiding this comment

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

@edyoshikun and @ziw-liu have you executed this and the following cells to test that the model can be trained? If so, let's keep the VSCyto3D model here. Otherwise, you can delete this part of the exercise.

@mattersoflight mattersoflight mentioned this pull request Jul 19, 2024
@edyoshikun edyoshikun merged commit 059ca38 into main Jul 19, 2024
4 checks passed
@edyoshikun edyoshikun deleted the update_dlmbl branch July 19, 2024 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants