-
Notifications
You must be signed in to change notification settings - Fork 13
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
Training docs #14
Conversation
Disclaimer for MemBrain being under development Co-authored-by: Kevin Yamauchi <kevin.yamauchi@gmail.com>
Remove mkdocs description. Co-authored-by: Kevin Yamauchi <kevin.yamauchi@gmail.com>
remove redundant comment Co-authored-by: Kevin Yamauchi <kevin.yamauchi@gmail.com>
docs/Usage/Preprocessing.md
Outdated
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.
Already had that in the previous PR, so not sure why it appears here again :/
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 think you may have branched this off of your previous branch instead of main. No worries though, thanks for flagging it.
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.
Ah, yes, that's exactly what I did!
src/membrain_seg/cli/train_cli.py
Outdated
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 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.
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.
cool! I like the separation of APIs for advanced and beginner users.
src/membrain_seg/segment.py
Outdated
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.
Remove parsing and write "segment" as a callable function
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.
super nice
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.
LGTM! I left some minor comments below. Please feel free to merge once you accept/reject them.
docs/Usage/Preprocessing.md
Outdated
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 think you may have branched this off of your previous branch instead of main. No worries though, thanks for flagging it.
```shell | ||
membrain | ||
``` | ||
This should display the different options you can choose from MemBrain, like "segment" and "train". |
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 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.
src/membrain_seg/cli/train_cli.py
Outdated
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.
cool! I like the separation of APIs for advanced and beginner users.
src/membrain_seg/segment.py
Outdated
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.
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. |
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.
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. |
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 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).
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.
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!
@LorenzLamm , let me know if you want some help with the merge conflict! We can jump on zoom and pair on it. |
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>
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 :/