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)
| 238 | |
| 239 | |
| 240 | def 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 | |
| 264 | def resnet_v2_50(inputs, |
no test coverage detected