MCPcopy Create free account
hub / github.com/Project-MONAI/MONAI / DenseNet121

Class DenseNet121

monai/networks/nets/densenet.py:296–326  ·  view source on GitHub ↗

DenseNet121 with optional pretrained support when `spatial_dims` is 2.

Source from the content-addressed store, hash-verified

294
295
296class DenseNet121(DenseNet):
297 """DenseNet121 with optional pretrained support when `spatial_dims` is 2."""
298
299 def __init__(
300 self,
301 spatial_dims: int,
302 in_channels: int,
303 out_channels: int,
304 init_features: int = 64,
305 growth_rate: int = 32,
306 block_config: Sequence[int] = (6, 12, 24, 16),
307 pretrained: bool = False,
308 progress: bool = True,
309 **kwargs,
310 ) -> None:
311 super().__init__(
312 spatial_dims=spatial_dims,
313 in_channels=in_channels,
314 out_channels=out_channels,
315 init_features=init_features,
316 growth_rate=growth_rate,
317 block_config=block_config,
318 **kwargs,
319 )
320 if pretrained:
321 if spatial_dims > 2:
322 raise NotImplementedError(
323 "Parameter `spatial_dims` is > 2 ; currently PyTorch Hub does not"
324 "provide pretrained models for more than two spatial dimensions."
325 )
326 _load_state_dict(self, "densenet121", progress)
327
328
329class DenseNet169(DenseNet):

Callers 8

run_training_testFunction · 0.90
run_inference_testFunction · 0.90
setUpMethod · 0.90
test_shapeMethod · 0.90
test_illMethod · 0.90
test_shapeMethod · 0.90

Calls

no outgoing calls

Tested by 6

run_training_testFunction · 0.72
run_inference_testFunction · 0.72
setUpMethod · 0.72
test_shapeMethod · 0.72
test_illMethod · 0.72
test_shapeMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…