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

Class SegResNetVAE

monai/networks/nets/segresnet.py:187–338  ·  view source on GitHub ↗

SegResNetVAE based on `3D MRI brain tumor segmentation using autoencoder regularization `_. The module contains the variational autoencoder (VAE). The model supports 2D or 3D inputs. Args: input_image_size: the size of images to inp

Source from the content-addressed store, hash-verified

185
186
187class SegResNetVAE(SegResNet):
188 """
189 SegResNetVAE based on `3D MRI brain tumor segmentation using autoencoder regularization
190 <https://arxiv.org/pdf/1810.11654.pdf>`_.
191 The module contains the variational autoencoder (VAE).
192 The model supports 2D or 3D inputs.
193
194 Args:
195 input_image_size: the size of images to input into the network. It is used to
196 determine the in_features of the fc layer in VAE.
197 vae_estimate_std: whether to estimate the standard deviations in VAE. Defaults to ``False``.
198 vae_default_std: if not to estimate the std, use the default value. Defaults to 0.3.
199 vae_nz: number of latent variables in VAE. Defaults to 256.
200 Where, 128 to represent mean, and 128 to represent std.
201 spatial_dims: spatial dimension of the input data. Defaults to 3.
202 init_filters: number of output channels for initial convolution layer. Defaults to 8.
203 in_channels: number of input channels for the network. Defaults to 1.
204 out_channels: number of output channels for the network. Defaults to 2.
205 dropout_prob: probability of an element to be zero-ed. Defaults to ``None``.
206 act: activation type and arguments. Defaults to ``RELU``.
207 norm: feature normalization type and arguments. Defaults to ``GROUP``.
208 use_conv_final: if add a final convolution block to output. Defaults to ``True``.
209 blocks_down: number of down sample blocks in each layer. Defaults to ``[1,2,2,4]``.
210 blocks_up: number of up sample blocks in each layer. Defaults to ``[1,1,1]``.
211 upsample_mode: [``"deconv"``, ``"nontrainable"``, ``"pixelshuffle"``]
212 The mode of upsampling manipulations.
213 Using the ``nontrainable`` modes cannot guarantee the model&#x27;s reproducibility. Defaults to``nontrainable``.
214
215 - ``deconv``, uses transposed convolution layers.
216 - ``nontrainable``, uses non-trainable `linear` interpolation.
217 - ``pixelshuffle``, uses :py:class:`monai.networks.blocks.SubpixelUpsample`.
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,

Callers 2

test_vae_shapeMethod · 0.90
test_scriptMethod · 0.90

Calls

no outgoing calls

Tested by 2

test_vae_shapeMethod · 0.72
test_scriptMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…