MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / resnet_v2_block

Function resnet_v2_block

tensorflow/contrib/slim/python/slim/nets/resnet_v2.py:240–261  ·  view source on GitHub ↗

Helper function for creating a resnet_v2 bottleneck block. Args: scope: The scope of the block. base_depth: The depth of the bottleneck layer for each unit. num_units: The number of units in the block. stride: The stride of the block, implemented as a stride in the last unit.

(scope, base_depth, num_units, stride)

Source from the content-addressed store, hash-verified

238
239
240def resnet_v2_block(scope, base_depth, num_units, stride):
241 """Helper function for creating a resnet_v2 bottleneck block.
242
243 Args:
244 scope: The scope of the block.
245 base_depth: The depth of the bottleneck layer for each unit.
246 num_units: The number of units in the block.
247 stride: The stride of the block, implemented as a stride in the last unit.
248 All other units have stride=1.
249
250 Returns:
251 A resnet_v2 bottleneck block.
252 """
253 return resnet_utils.Block(scope, bottleneck, [{
254 'depth': base_depth * 4,
255 'depth_bottleneck': base_depth,
256 'stride': 1
257 }] * (num_units - 1) + [{
258 'depth': base_depth * 4,
259 'depth_bottleneck': base_depth,
260 'stride': stride
261 }])
262
263
264def resnet_v2_50(inputs,

Callers 4

resnet_v2_50Function · 0.85
resnet_v2_101Function · 0.85
resnet_v2_152Function · 0.85
resnet_v2_200Function · 0.85

Calls 1

BlockMethod · 0.80

Tested by

no test coverage detected