conv3d_blocks
3D convolution block with optional normalization and activation.
Classes:
-
Conv3dBlock–Single
nn.Conv3d+ optionalnn.BatchNorm3d+ optional activation.
Conv3dBlock
¶
Conv3dBlock(
in_channels: int,
out_channels: int,
kernel_size: int = 3,
*,
act: Union[str, Callable, None] = "relu",
act_first: bool = False,
act_kwargs: Optional[Dict[str, Any]] = None,
norm: Union[str, Callable, None] = "batch_norm",
norm_kwargs: Optional[Dict[str, Any]] = None,
bias: bool = True,
)
Bases: Module
Single nn.Conv3d + optional nn.BatchNorm3d + optional activation.
Shape
Input: \((B, C_\text{in}, R, R, R)\) Output: \((B, C_\text{out}, R, R, R)\)
Parameters:
-
in_channels(int) –Input channel count.
-
out_channels(int) –Output channel count.
-
kernel_size(int, default:3) –Conv3d kernel size.
-
act(Union[str, Callable, None], default:'relu') –Activation, name resolved by
create_act.Nonedisables. -
act_first(bool, default:False) –If
True, run activation before normalization. -
act_kwargs(Optional[Dict[str, Any]], default:None) –Extra kwargs for the activation.
-
norm(Union[str, Callable, None], default:'batch_norm') –Normalization, name resolved by
create_norm.Nonedisables. -
norm_kwargs(Optional[Dict[str, Any]], default:None) –Extra kwargs for the normalization.
-
bias(bool, default:True) –Whether the Conv3d has a bias term.