MCPcopy Index your code
hub / github.com/tensorpack/tensorpack / get_bn

Function get_bn

examples/Saliency/resnet_model.py:19–26  ·  view source on GitHub ↗

Zero init gamma is good for resnet. See https://arxiv.org/abs/1706.02677.

(zero_init=False)

Source from the content-addressed store, hash-verified

17
18
19def get_bn(zero_init=False):
20 """
21 Zero init gamma is good for resnet. See https://arxiv.org/abs/1706.02677.
22 """
23 if zero_init:
24 return lambda x, name=None: BatchNorm('bn', x, gamma_initializer=tf.zeros_initializer())
25 else:
26 return lambda x, name=None: BatchNorm('bn', x)
27
28
29# ----------------- pre-activation resnet ----------------------

Callers 4

resnet_basicblockFunction · 0.70
resnet_bottleneckFunction · 0.70
se_bottleneckFunction · 0.70
resnext32x4d_bottleneckFunction · 0.70

Calls 1

BatchNormFunction · 0.90

Tested by

no test coverage detected