-
Notifications
You must be signed in to change notification settings - Fork 49
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
Conv-TasNet Cumulative Layer Norm Bug? #101
Comments
My |
compared to the official implementation, your code writes cum_var=cum_squared_mean - cum_mean**2 while the official code writes cum_var = (cum_pow_sum - 2cum_meancum_sum) / entry_cnt + cum_mean.pow(2). then cum_squared_mean should = (cum_pow_sum - 2cum_meancum_sum) / entry_cnt however cum_squared_sum is defined as torch.cumsum(step_pow_sum, dim=1) which equals cum_pow_sum in the official implementation, so you're missing 2cum_meancum_sum. am I missing anything here? or is this omitted for a speed / accuracy tradeoff? |
I renamed some variables in |
My bad! thank you for clearing it up! |
shouldn't lines 78-92 be
`
step_sum = input.sum(dim=1) # -> (batch_size, T)
cum_sum = torch.cumsum(step_sum, dim=1) # -> (batch_size, T)
cum_num = torch.arange(C, C*(T+1), C, dtype=torch.float) # -> (T, ): [C, 2C, ..., TC]
cum_mean = cum_sum / cum_num # (batch_size, T)
cum_var = (cum_sum - cum_mean)**2/cum_num
cum_mean = cum_mean.unsqueeze(dim=1)
cum_var = cum_var.unsqueeze(dim=1)
output = (input - cum_mean) / (torch.sqrt(cum_var) + eps) * self.gamma + self.beta
`
according to the Conv-TasNet paper?
The text was updated successfully, but these errors were encountered: