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

Implement the ability to use layernorm with resnet models #7294

Closed
MiguelMonteiro opened this issue Dec 6, 2023 · 3 comments · Fixed by #7752
Closed

Implement the ability to use layernorm with resnet models #7294

MiguelMonteiro opened this issue Dec 6, 2023 · 3 comments · Fixed by #7752
Assignees
Labels

Comments

@MiguelMonteiro
Copy link

Is your feature request related to a problem? Please describe.
Batch norm can be problematic with small batch sizes and certain applications due to computing running batch statistics. Layernorm does not have this problem but it is not available to use in with monai's resnet models:

from monai.networks.nets.resnet import ...

Describe the solution you'd like
Implement the ability to use layer norm with resnet models

Describe alternatives you've considered
I have tried using other models which support layer norm such as densenet but it seems to be broken also. See #7293

@KumoLiu KumoLiu added enhancement New feature or request Contribution wanted labels Dec 7, 2023
@aymuos15
Copy link

aymuos15 commented Dec 8, 2023

Hi @KumoLiu

Could I work on this?

@KumoLiu
Copy link
Contributor

KumoLiu commented Dec 8, 2023

@aymuos15, sure, please refer to the CONTRIBUTION GUIDE.

@aymuos15
Copy link

aymuos15 commented Dec 8, 2023

Thank you!

@Pkaps25 Pkaps25 mentioned this issue May 9, 2024
7 tasks
KumoLiu added a commit that referenced this issue May 23, 2024
Fixes #7294  .

### Description
Adds a `norm` param to ResNet

### Types of changes
<!--- Put an `x` in all the boxes that apply, and remove the not
applicable items -->
- [x] Non-breaking change (fix or new feature that would not break
existing functionality).
- [ ] Breaking change (fix or new feature that would cause existing
functionality to change).
- [x] New tests added to cover the changes.
- [x] Integration tests passed locally by running `./runtests.sh -f -u
--net --coverage`.
- [x] Quick tests passed locally by running `./runtests.sh --quick
--unittests --disttests`.
- [x] In-line docstrings updated.
- [x] Documentation updated, tested `make html` command in the `docs/`
folder.

---------

Signed-off-by: Peter Kaplinsky <peterkaplinsky@gmail.com>
Co-authored-by: Peter Kaplinsky <peterkaplinsky@gmail.com>
Co-authored-by: YunLiu <55491388+KumoLiu@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants