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

Function resnet_shortcut

examples/Saliency/resnet_model.py:10–16  ·  view source on GitHub ↗
(l, n_out, stride, activation=tf.identity)

Source from the content-addressed store, hash-verified

8
9
10def resnet_shortcut(l, n_out, stride, activation=tf.identity):
11 data_format = get_arg_scope()['Conv2D']['data_format']
12 n_in = l.get_shape().as_list()[1 if data_format in ['NCHW', 'channels_first'] else 3]
13 if n_in != n_out: # change dimension when channel is not the same
14 return Conv2D('convshortcut', l, n_out, 1, strides=stride, activation=activation)
15 else:
16 return l
17
18
19def get_bn(zero_init=False):

Callers 6

preact_basicblockFunction · 0.70
preact_bottleneckFunction · 0.70
resnet_basicblockFunction · 0.70
resnet_bottleneckFunction · 0.70
se_bottleneckFunction · 0.70
resnext32x4d_bottleneckFunction · 0.70

Calls 2

get_arg_scopeFunction · 0.90
Conv2DFunction · 0.90

Tested by

no test coverage detected