Block Layers#

Classes#

class ConvNeXtBlock(net_out, shapes, *, drop_path=0, layer_scale=1e-06, **kwargs)[source]#

Bases: BaseSingleLayer

ConvNeXt block using BaseLayer.

Original paper implementation: arXiv:2201.03545.

Attributes:
groupint

Layer group, if 0 it will always be used, else it will only be used if its group matches the Networks

descriptionstr

Description of the layer

layersSequential

Layers part of the parent layer to loop through in the forward pass

shapesShapes

Layer output shapes

check_shapesShapes

Checkpoint output shapes

Parameters:
net_outlist[int]

Shape of the network’s output, required only if layer contains factor

shapesShapes

Shape of the outputs from each layer

drop_pathfloat, Optional

Probability of Drop Path dropout, default = 0

layer_scalefloat, Optional

Initial scale factor for layer Scale, default = 1e-6

**kwargs

Leftover parameters for checking if they are valid

forward(x, outputs, checkpoints, *_, **__)[source]#

Forward pass for the ConvNeXt block

Parameters:
xTensorListLike

Input with tensors of shape (N,…) and type float, where N is the batch size

outputslist[TensorListLike]

Output from each layer with tensors of shape (N,…) and type float

checkpointslist[TensorListLike]

List of checkpoint values with tensors of shape (N,…) and type float

Returns:
Tensor

Output tensor with shape (N,…) and type float