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

batchnorm layer variance exist negative numbers #87

Open
KimmiShi opened this issue May 31, 2021 · 3 comments
Open

batchnorm layer variance exist negative numbers #87

KimmiShi opened this issue May 31, 2021 · 3 comments

Comments

@KimmiShi
Copy link

Hi, I found that the variance of batchnorm is negative, why a negative numbe is generated? Since the formula of variance is (X-mean)^2, it should always be positive?

reproduce:

>>> net=caffe.Net("mobilenet_v2_deploy.prototxt", "mobilenet_v2.caffemodel",caffe.TEST)
>>> data=net.params["conv2_1/dwise/bn"]
>>> data[1].data

In my machine, I got:

array([ 4.7596052e-02,  7.3651361e-01,  2.2111790e-02,  1.4638673e-01,
        8.1408697e-01,  4.1462550e+00, -9.9998997e-06,  7.0890152e-01,
        8.2080442e-01,  4.6168277e-01,  6.0621478e-02,  4.0049631e-02,
        7.5143494e-02, -9.9998997e-06,  7.3541865e-02,  1.2164615e+00,
        6.9410698e-03,  7.8000981e-01,  7.2208607e-01, -9.9998997e-06,
       -9.9998997e-06, -9.9920235e-06,  9.2403132e-01,  6.2930644e-01,
        6.8191504e-01,  2.1945512e+00, -4.9380765e-06,  9.1005945e-01,
        1.0808281e+00,  1.7053494e+00,  5.6995720e-01,  2.4290257e+00],
      dtype=float32)
@JingaoHu
Copy link

I also fuond that and wonder why.

@lcj820
Copy link

lcj820 commented Jan 11, 2022 via email

@changan1tao
Copy link

changan1tao commented Jan 11, 2022 via email

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

4 participants