(
self,
input_image_size: Sequence[int],
vae_estimate_std: bool = False,
vae_default_std: float = 0.3,
vae_nz: int = 256,
spatial_dims: int = 3,
init_filters: int = 8,
in_channels: int = 1,
out_channels: int = 2,
dropout_prob: float | None = None,
act: str | tuple = ("RELU", {"inplace": True}),
norm: tuple | str = ("GROUP", {"num_groups": 8}),
use_conv_final: bool = True,
blocks_down: tuple = (1, 2, 2, 4),
blocks_up: tuple = (1, 1, 1),
upsample_mode: UpsampleMode | str = UpsampleMode.NONTRAINABLE,
)
| 218 | """ |
| 219 | |
| 220 | def __init__( |
| 221 | self, |
| 222 | input_image_size: Sequence[int], |
| 223 | vae_estimate_std: bool = False, |
| 224 | vae_default_std: float = 0.3, |
| 225 | vae_nz: int = 256, |
| 226 | spatial_dims: int = 3, |
| 227 | init_filters: int = 8, |
| 228 | in_channels: int = 1, |
| 229 | out_channels: int = 2, |
| 230 | dropout_prob: float | None = None, |
| 231 | act: str | tuple = ("RELU", {"inplace": True}), |
| 232 | norm: tuple | str = ("GROUP", {"num_groups": 8}), |
| 233 | use_conv_final: bool = True, |
| 234 | blocks_down: tuple = (1, 2, 2, 4), |
| 235 | blocks_up: tuple = (1, 1, 1), |
| 236 | upsample_mode: UpsampleMode | str = UpsampleMode.NONTRAINABLE, |
| 237 | ): |
| 238 | super().__init__( |
| 239 | spatial_dims=spatial_dims, |
| 240 | init_filters=init_filters, |
| 241 | in_channels=in_channels, |
| 242 | out_channels=out_channels, |
| 243 | dropout_prob=dropout_prob, |
| 244 | act=act, |
| 245 | norm=norm, |
| 246 | use_conv_final=use_conv_final, |
| 247 | blocks_down=blocks_down, |
| 248 | blocks_up=blocks_up, |
| 249 | upsample_mode=upsample_mode, |
| 250 | ) |
| 251 | |
| 252 | self.input_image_size = input_image_size |
| 253 | self.smallest_filters = 16 |
| 254 | |
| 255 | zoom = 2 ** (len(self.blocks_down) - 1) |
| 256 | self.fc_insize = [s // (2 * zoom) for s in self.input_image_size] |
| 257 | |
| 258 | self.vae_estimate_std = vae_estimate_std |
| 259 | self.vae_default_std = vae_default_std |
| 260 | self.vae_nz = vae_nz |
| 261 | self._prepare_vae_modules() |
| 262 | self.vae_conv_final = self._make_final_conv(in_channels) |
| 263 | |
| 264 | def _prepare_vae_modules(self): |
| 265 | zoom = 2 ** (len(self.blocks_down) - 1) |
nothing calls this directly
no test coverage detected