lvae_model
LVAE Pydantic model.
LVAEModel
#
Bases: ArchitectureModel
LVAE model.
Source code in src/careamics/config/architectures/lvae_model.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 |
|
architecture
instance-attribute
#
Name of the architecture.
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 (C, Z, Y, X) or (C, 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. |
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 |
Source code in src/careamics/config/architectures/lvae_model.py
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. |
Source code in src/careamics/config/architectures/lvae_model.py
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. |
Source code in src/careamics/config/architectures/lvae_model.py
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. |
Source code in src/careamics/config/architectures/lvae_model.py
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. |
Source code in src/careamics/config/architectures/lvae_model.py
validate_multiscale_count()
#
Validate the multiscale count.
Returns:
Type | Description |
---|---|
Self | The validated model. |
Source code in src/careamics/config/architectures/lvae_model.py
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. |