This repository was archived by the owner on Nov 17, 2023. It is now read-only.
One question about batch norm code when setting use_global_stats True. #13399
Unanswered
qingqing01
asked this question in
Q&A
Replies: 1 comment
-
@mxnet-label-bot add [Question] |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
In the cuDNN impl of batch norm, the code in
src/operator/nn/cudnn/cudnn_batch_norm-inl.h
is:https://github.com/apache/incubator-mxnet/blob/master/src/operator/nn/cudnn/cudnn_batch_norm-inl.h#L211
In the cuDNN impl of batch norm, why the savedMean and savedInvVariance are nullptr when
global_stats
is True? From the cuDNN doc:https://docs.nvidia.com/deeplearning/sdk/cudnn-developer-guide/index.html#cudnnBatchNormalizationBackward
it seems that when these two arguments are nullptr, the
cudnnBatchNormalizationBackward
will calculate mean/var by using the input X inner this API. I think it is not equivalent to thereal
backward (see following format ) whenglobal_stats
is True and using global mean/variance in forward.When using global mean/variance,
the forward is:
y = scale * ( (x-global_mean) / sqrt(global_var) ) + bias
the dx is:
dx = scale * dy / sqrt(global_var)
So, I'm a little confused.
Beta Was this translation helpful? Give feedback.
All reactions