apeforest commented on a change in pull request #13557: Fix BatchNorm converter
for CoreML when fix_gamma=True
URL: https://github.com/apache/incubator-mxnet/pull/13557#discussion_r248155089
##########
File path: tools/coreml/test/test_mxnet_converter.py
##########
@@ -938,6 +938,40 @@ def test_batch_norm_no_global_stats(self):
name='batch_norm_1')
self._test_mxnet_model(net, input_shape=input_shape, mode='random',
delta=1e-2)
+ def test_batch_norm_with_fix_gamma(self):
+ """ The gamma will always be an array of ones when fix_gamma=True. The
values
+ of gamma may be changed accidentally if there have been
fix_gamma=False before
+ the final trained model.
+ """
+ np.random.seed(1988)
+ input_shape = (1, 2, 2, 3)
Review comment:
Why not use (1, 1, 2, 3) as in previous `test_batch_norm()` tests? I think
it can be helpful to choose the same input_shape to test the default behavior
when fix_gamma is not specified. Ideally, the result should be the same as you
supply fix_gamma=True.
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services