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

Question About LayerNorm Implementation #35

Closed
Guaishou74851 opened this issue Jun 11, 2022 · 2 comments
Closed

Question About LayerNorm Implementation #35

Guaishou74851 opened this issue Jun 11, 2022 · 2 comments

Comments

@Guaishou74851
Copy link

Guaishou74851 commented Jun 11, 2022

Hi, your work is really inspiring and interesting!
I am wondering why you re-implement LayerNorm (2D), instead of using PyTorch modules like nn.GroupNorm(1, channels)?
Are there some differences between them (e.g. final performance or function differences)?

@mayorx
Copy link
Collaborator

mayorx commented Jun 11, 2022

Hi, Guaishou74851,
Thanks for your attention to NAFNet.
You can regard the code as a re-implementation of https://github.com/facebookresearch/ConvNeXt/blob/main/models/convnext.py#L138-L143, which behaves differently from nn.GroupNorm(1, channels). We re-implement it to save GPU memory cost.

@Luciennnnnnn
Copy link

@mayorx Hi, I observe a different optimization behavior between your implementation and connext's, how it occurs?

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

No branches or pull requests

3 participants