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

Training docs #14

Merged
merged 32 commits into from
Jun 21, 2023
Merged

Training docs #14

merged 32 commits into from
Jun 21, 2023

Conversation

LorenzLamm
Copy link
Collaborator

Added documentation particularly for segmentation. Training step still needs detailed documentation.
I also added the Typer CLIs for the segmentations and added docstrings to all methods in the training/segmentation section.

Sorry it got that long again. I guess I should not have combined these three things into one PR, but initially it seemed to me like they go hand-in-hand :/

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Already had that in the previous PR, so not sure why it appears here again :/

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think you may have branched this off of your previous branch instead of main. No worries though, thanks for flagging it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ah, yes, that's exactly what I did!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm using the "train" and "train_advanced" methods here. The "train" method simply requires the path to the training data and will then train the segmentation model with the standard parameters.

If users would like to change anything, they can go for the "train_advanced" method.

Copy link
Collaborator

Choose a reason for hiding this comment

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

cool! I like the separation of APIs for advanced and beginner users.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Remove parsing and write "segment" as a callable function

Copy link
Collaborator

Choose a reason for hiding this comment

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

super nice

Copy link
Collaborator

@kevinyamauchi kevinyamauchi left a comment

Choose a reason for hiding this comment

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

LGTM! I left some minor comments below. Please feel free to merge once you accept/reject them.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think you may have branched this off of your previous branch instead of main. No worries though, thanks for flagging it.

docs/index.md Outdated Show resolved Hide resolved
docs/installation.md Outdated Show resolved Hide resolved
docs/installation.md Outdated Show resolved Hide resolved
```shell
membrain
```
This should display the different options you can choose from MemBrain, like "segment" and "train".
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this is okay for now, but it can be nice to include a screenshot so the user knows how it looks when they have installed everything correctly.

Copy link
Collaborator

Choose a reason for hiding this comment

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

cool! I like the separation of APIs for advanced and beginner users.

Copy link
Collaborator

Choose a reason for hiding this comment

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

super nice

@@ -65,7 +97,18 @@ def forward(self, data: torch.Tensor, target: torch.Tensor) -> torch.Tensor:


class DeepSuperVisionLoss(_Loss):
"""Deep Supervision loss using downsampled GT and low-res outputs."""
"""
Deep Supervision loss using downsampled GT and low-res outputs.
Copy link
Collaborator

Choose a reason for hiding this comment

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

If possible, it would be nice to include a reference here.

seg_path: str, orig_tomo_path: str, output_path: str
) -> None:
"""
Match the pixel size of the input segmentation to the target tomogram.
Copy link
Collaborator

Choose a reason for hiding this comment

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

It might be nice to clarify that this is done by matching the image shapes, which assumes the images have the same extent in physical units (assuming I understood the code correctly).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, you are right. It assumes that images have the same physical extent. It's mainly for the use-case where the user wants to map the rescaled segmentation (after pixel-size-matching to training range) back to the original tomogram.
But it definitely makes sense to also describe this more precisely!

@kevinyamauchi
Copy link
Collaborator

@LorenzLamm , let me know if you want some help with the merge conflict! We can jump on zoom and pair on it.

LorenzLamm and others added 6 commits June 21, 2023 10:25
Co-authored-by: Kevin Yamauchi <kevin.yamauchi@gmail.com>
Co-authored-by: Kevin Yamauchi <kevin.yamauchi@gmail.com>
Co-authored-by: Kevin Yamauchi <kevin.yamauchi@gmail.com>
@LorenzLamm LorenzLamm marked this pull request as ready for review June 21, 2023 09:51
@LorenzLamm LorenzLamm merged commit 018672b into main Jun 21, 2023
@LorenzLamm LorenzLamm deleted the training_docs branch June 26, 2023 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants