-
Notifications
You must be signed in to change notification settings - Fork 374
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
Update for subsample masking API #167
Conversation
8451f29
to
18cb8bb
Compare
18cb8bb
to
12cf3a5
Compare
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 didn't check the mask logic deeply, but the overall refactor makes sense to me. Left some minor comments.
@@ -252,6 +253,29 @@ def normalize_instance( | |||
return normalize(data, mean, std, eps), mean, std | |||
|
|||
|
|||
class UnetSample(NamedTuple): |
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.
Mostly out of curiosity, any reason to prefer this over a dataclass?
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.
To make it more like a tuple! Immutability is great.
ef38421
to
56d49c1
Compare
I'm going to go ahead and merge this - ran some tests on the knee data and it seems SSIM is the same throughout the training process. I'll do a full validation with leaderboard submission prior to the next package release to PyPI. |
This update implements a major overhaul of the masking API for the repository. The primary reason for doing this was to implement the magic mask in the core repository. Already, we had repeated code in several sections, and with the new mask this would be duplicated again and be bad for maintenance. With the new code structure, everything is subclassed from a base mask function in a modular way, so for the future we'll hopefully only need to change the base class to make updates.
We also implemented a few other things that came from the internal fastMRI repository (most of which has already been exposed via
banding_removal
). These include returning the number of low frequency lines (for sensitivity map estimation) and segmenting out the equispaced mask from the pseudo-equispaced mask mentioned in Issue #54.Note: for the old equispaced mask behavior, you now need to use
EquispacedMaskFraction
.EquispacedMask
now implements exactly an equispaced mask, as its title suggests. The VarNet and U-Net examples should be updated accordingly with this PR.Lastly, this PR updates the test environment to bring all dependencies up to date for September 2021 for unit testing. It supersedes #166, as it seems the
mypy
update required changes to several parts of the code, so I thought it was easier to include here.CC @adefazio @Timsey