LVAE Config
LVAE Pydantic model.
LVAEConfig
Bases: ArchitectureConfig
LVAE model.
decoder_conv_strides = Field(default=[2, 2], validate_default=True)
class-attribute
instance-attribute
Dimensions (2D or 3D) of the convolutional layers.
input_shape = Field(default=(64, 64), validate_default=True)
class-attribute
instance-attribute
Shape of the input patch (Z, Y, X) or (Y, X) if the data is 2D.
is_3D()
Return whether the model is 3D or not.
Returns:
| Type | Description |
|---|---|
bool
|
Whether the model is 3D or not. |
model_dump(**kwargs)
set_3D(is_3D)
Set 3D model by setting the conv_dims parameters.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
is_3D
|
bool
|
Whether the algorithm is 3D or not. |
required |
validate_conv_strides()
Validate the convolutional strides.
Returns:
| Type | Description |
|---|---|
list
|
Validated strides. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the number of strides is not 2. |
validate_decoder_even(decoder_n_filters)
classmethod
Validate that num_channels_init is even.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
decoder_n_filters
|
int
|
Number of channels. |
required |
Returns:
| Type | Description |
|---|---|
int
|
Validated number of channels. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the number of channels is odd. |
validate_encoder_even(encoder_n_filters)
classmethod
Validate that num_channels_init is even.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
encoder_n_filters
|
int
|
Number of channels. |
required |
Returns:
| Type | Description |
|---|---|
int
|
Validated number of channels. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the number of channels is odd. |
validate_input_shape(input_shape)
classmethod
Validate the input shape.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input_shape
|
list
|
Shape of the input patch. |
required |
Returns:
| Type | Description |
|---|---|
list
|
Validated input shape. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the number of dimensions is not 3 or 4. |
validate_multiscale_count()
validate_z_dims(z_dims)
Validate the z_dims.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
z_dims
|
tuple
|
Tuple of z dimensions. |
required |
Returns:
| Type | Description |
|---|---|
tuple
|
Validated z dimensions. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the number of z dimensions is not 4. |