conv3d_blocks
3D convolution block with optional normalization and activation.
Classes:
-
Conv3dBlockβSingle
nn.Conv3d+ optionalnn.BatchNorm3d+ optional activation.
Conv3dBlock [source] ΒΆ
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.