Skip to content

Commit

Permalink
Merge pull request #1948 from mavenlin/master
Browse files Browse the repository at this point in the history
small fix to batchnorm
  • Loading branch information
antinucleon committed Apr 25, 2016
2 parents d95d7d1 + 89d81ad commit 8b1b2b9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion python/mxnet/initializer.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def __call__(self, name, arr):
elif name.endswith("moving_mean"):
self._init_zero(name, arr)
elif name.endswith("moving_var"):
self._init_zero(name, arr)
self._init_one(name, arr)
elif name.endswith("moving_inv_var"):
self._init_zero(name, arr)
elif name.endswith("moving_avg"):
Expand All @@ -62,6 +62,9 @@ def _init_bilinear(self, _, arr):
def _init_zero(self, _, arr):
arr[:] = 0.0

def _init_one(self, _, arr):
arr[:] = 1.0

def _init_bias(self, _, arr):
arr[:] = 0.0

Expand Down
2 changes: 1 addition & 1 deletion src/operator/cudnn_batch_norm-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ class CuDNNBatchNormOp : public Operator {
mean_desc_,
gamma.dptr_,
beta.dptr_,
param_.momentum,
1 - param_.momentum,
moving_mean.dptr_,
moving_inv_var.dptr_,
param_.eps,
Expand Down

0 comments on commit 8b1b2b9

Please sign in to comment.