The Wayback Machine - https://web.archive.org/web/20201129210415/https://github.com/tensorlayer/tensorlayer/issues/1096
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

Weird code in batch normalization #1096

Open
WyldeCat opened this issue Jul 13, 2020 · 1 comment
Open

Weird code in batch normalization #1096

WyldeCat opened this issue Jul 13, 2020 · 1 comment

Comments

@WyldeCat
Copy link

@WyldeCat WyldeCat commented Jul 13, 2020

New Issue Checklist

Issue Description

https://github.com/tensorlayer/tensorlayer/blob/master/tensorlayer/layers/normalization.py#L291

        if self.axes is None:
            self.axes = [i for i in range(len(inputs.shape)) if i != self.channel_axis]

If I understood correctly, the above code is calculating axes to get means and variances for the normalization.
But it looks weird to me because self.channel_axis can be -1. Shouldn't this change like this or something similar?

        if self.axes is None:
            self.axes = [i for i in range(len(inputs.shape)) if i != self.channel_axis]
            if self.channel_axis == -1:
                self.axes = self.axes[-1]
@Laicheng0830
Copy link
Member

@Laicheng0830 Laicheng0830 commented Oct 10, 2020

Thanks! there is a problem with this code, we will fix it immediately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.