etzinis / sudo_rm_rf

Code for SuDoRm-Rf networks for efficient audio source separation. SuDoRm-Rf stands for SUccessive DOwnsampling and Resampling of Multi-Resolution Features which enables a more efficient way of separating sources from mixtures.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

global layer normalization

fjiang9 opened this issue · comments

Hi, Efthymios
Thanks for sharing the code!
Is this code

self.norm = nn.GroupNorm(1, nOut, eps=1e-08)

the "global layer normalization" mentioned in the paper?

I think this implementation makes no difference with nn.GroupNorm(1, nOut, eps=1e-08). Here is the test code:
import torch
import torch.nn as nn

x = torch.rand(2, 4, 3)
ln = nn.GroupNorm(1, 4, eps=1e-8)
print(ln(x))
print((x-x.mean(dim=[1, 2], keepdims=True))/(x.var(dim=[1, 2], keepdims=True, unbiased=False)+1e-8).sqrt()) # This is equivalent to your implementation except for the affine operation