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

Is the operation in SGE-Block equivalent to GroupNorm ? #33

Open
mrT23 opened this issue Jan 30, 2020 · 1 comment
Open

Is the operation in SGE-Block equivalent to GroupNorm ? #33

mrT23 opened this issue Jan 30, 2020 · 1 comment

Comments

@mrT23
Copy link

mrT23 commented Jan 30, 2020

Hi.
I have two questions:

Question 1:

        t = t - t.mean(dim=1, keepdim=True)
        std = t.std(dim=1, keepdim=True) + 1e-5
        t = t / std
        t = t.view(b, self.groups, h, w)
        t = t * self.weight + self.bias

it this code equivalent to batchNorm (or GroupNorm) ?
if so, shouldn't we use running_mean and running_var to stabilize the statistics and improve convergence ?

Question 2:
xn = xn.sum(dim=1, keepdim=True)
what it is logic behind this line ? why are summing along the groups ?

thanks a lot
Tal

@Haus226
Copy link

Haus226 commented Aug 31, 2024

For question 2, I think it is used to reduce the weighted channels in each group to obtain the attention map $a$
image

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

2 participants