SEResNet50 based on `Squeeze-and-Excitation Networks` with optional pretrained support when spatial_dims is 2.
| 352 | |
| 353 | |
| 354 | class SEResNet50(SENet): |
| 355 | """SEResNet50 based on `Squeeze-and-Excitation Networks` with optional pretrained support when spatial_dims is 2.""" |
| 356 | |
| 357 | def __init__( |
| 358 | self, |
| 359 | layers: Sequence[int] = (3, 4, 6, 3), |
| 360 | groups: int = 1, |
| 361 | reduction: int = 16, |
| 362 | dropout_prob: float | None = None, |
| 363 | inplanes: int = 64, |
| 364 | downsample_kernel_size: int = 1, |
| 365 | input_3x3: bool = False, |
| 366 | pretrained: bool = False, |
| 367 | progress: bool = True, |
| 368 | **kwargs, |
| 369 | ) -> None: |
| 370 | super().__init__( |
| 371 | block=SEResNetBottleneck, |
| 372 | layers=layers, |
| 373 | groups=groups, |
| 374 | reduction=reduction, |
| 375 | dropout_prob=dropout_prob, |
| 376 | inplanes=inplanes, |
| 377 | downsample_kernel_size=downsample_kernel_size, |
| 378 | input_3x3=input_3x3, |
| 379 | **kwargs, |
| 380 | ) |
| 381 | if pretrained: |
| 382 | # it only worked when `spatial_dims` is 2 |
| 383 | _load_state_dict(self, "se_resnet50", progress) |
| 384 | |
| 385 | |
| 386 | class SEResNet101(SENet): |
no outgoing calls
searching dependent graphs…