You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by gi...@git.apache.org on 2017/08/01 06:05:40 UTC

[GitHub] tonyyangToBeNo1 opened a new issue #7280: BatchNorm compute problem

tonyyangToBeNo1 opened a new issue #7280: BatchNorm compute problem
URL: https://github.com/apache/incubator-mxnet/issues/7280
 
 
   I am new to Mxnet and I am trying to implement a caffe code to Mxnet. The training phase is good but the testing phase goes wrong. 
   the output from the BatchNorm layers is 1000 times smaller than that from caffe's BN layers.
   my caffe prototxt is the following:
   ![image](https://user-images.githubusercontent.com/10970617/28811205-4737f37c-76c0-11e7-8b88-5bae0e5428c3.png)
   it does not have a scale layer so that the gamma=1 and beta=0.
   so here is my symbol in mxnet:
   ![image](https://user-images.githubusercontent.com/10970617/28811247-8140af28-76c0-11e7-9701-f9e68dec94e9.png)
   and I set eps=1e-5, use_global_stat=True and fix_gamma=False.
   
   and the following is the moving_mean from mxnet:
   ![image](https://user-images.githubusercontent.com/10970617/28811327-0949317e-76c1-11e7-8f38-764ecf58471c.png)
   this is the mean from caffe:
   ![image](https://user-images.githubusercontent.com/10970617/28811352-3b7fdaf8-76c1-11e7-8d9a-7eeedd28daf5.png)
   
   then the vars from mxnet:
   ![image](https://user-images.githubusercontent.com/10970617/28811367-4d4a5da8-76c1-11e7-9f7f-d3b7d3be3ae2.png)
   and the vars from caffe:
   ![image](https://user-images.githubusercontent.com/10970617/28811379-621a19e4-76c1-11e7-9cff-d8c150d2d393.png)
   
   Both the means and vars are similar in numbers but the mxnet ones are 1000 times smaller. 
   I init the weights with the following codes, but since other layers' params are fine, so the code should be ok:
   ![image](https://user-images.githubusercontent.com/10970617/28811437-c0889028-76c1-11e7-85b5-b020e7cab266.png)
   
   In the train phase the loss can convergence so that the symbols should be ok. 
   So could anyone helps, many thanks!
   
   
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services