fannypack.nn

Residual Blocks

class fannypack.nn.resblocks.Base(activation: str = 'relu', activations_inplace: bool = False)

Bases: torch.nn.modules.module.Module, abc.ABC

Base class for a generic residual block, with support for "relu", "leaky_relu", "selu", and "none" activations.

forward(x: torch.Tensor) → torch.Tensor

ResBlock forward pass.

class fannypack.nn.resblocks.Conv2d(channels: int, bottleneck_channels: int = None, kernel_size: int = 3, **resblock_base_args)

Bases: fannypack.nn.resblocks.Base

Standard convolutional residual block.

class fannypack.nn.resblocks.Linear(units: int, bottleneck_units: int = None, **resblock_base_args)

Bases: fannypack.nn.resblocks.Base

Standard linear residual block.