Conv2dBlock#

class deeplay.blocks.conv.conv2d.Conv2dBlock(*args, **kwargs)#

Bases: BaseBlock

Convolutional block with optional normalization and activation.

Attributes Summary

Methods Summary

call_with_dummy_data()

Calls the forward method with dummy data to build the block.

get_default_activation()

Returns the default activation function for the block.

get_default_merge()

Returns the default merge operation for the block.

get_default_normalization()

Returns the default normalization function for the block.

get_default_shortcut()

Returns the default shortcut function for the block.

normalized([normalization, mode, after])

pooled([pool, mode, after])

strided(stride[, remove_pool])

transposed([transpose, mode, after, ...])

upsampled([upsample, mode, after])

Attributes Documentation

expected_input_shape#

Methods Documentation

call_with_dummy_data()#

Calls the forward method with dummy data to build the block.

get_default_activation() DeeplayModule#

Returns the default activation function for the block.

get_default_merge() MergeOp#

Returns the default merge operation for the block.

get_default_normalization() DeeplayModule#

Returns the default normalization function for the block.

get_default_shortcut() DeeplayModule#

Returns the default shortcut function for the block.

normalized(normalization: ~typing.Type[~torch.nn.modules.module.Module] | ~deeplay.module.DeeplayModule = <class 'torch.nn.modules.batchnorm.BatchNorm2d'>, mode='append', after=None) Self#
pooled(pool: Layer = Layer[MaxPool2d](kernel_size=2, stride=2), mode='prepend', after=None) Self#
strided(stride: int | tuple[int, ...], remove_pool=True) Self#
transposed(transpose: Layer = Layer[ConvTranspose2d](kernel_size=2, stride=2, padding=0), mode='prepend', after=None, remove_upsample=True, remove_layer=True) Self#
upsampled(upsample: Layer = Layer[ConvTranspose2d](kernel_size=2, stride=2, padding=0), mode='append', after=None) Self#