RESNET18 PNN#

Classes#

class backbone.ResNet18_PNN.BasicBlockPnn(in_planes, planes, stride=1)[source]#

Bases: BasicBlock

The basic block of ResNet. Modified for PNN.

forward(x)[source]#

Compute a forward pass.

Parameters:

x (Tensor) – input tensor (batch_size, input_size)

Returns:

output tensor (10)

Return type:

Tensor

class backbone.ResNet18_PNN.ResNetPNN(block, num_blocks, num_classes, nf, old_cols=None, x_shape=None)[source]#

Bases: ResNet

ResNet network architecture modified for PNN.

forward(x, returnt='out')[source]#

Compute a forward pass.

Parameters:

x (Tensor) – input tensor (batch_size, *input_shape)

Returns:

output tensor (output_classes)

Return type:

Tensor

Functions#

backbone.ResNet18_PNN.resnet18_pnn(nclasses, nf=64, old_cols=None, x_shape=None)[source]#

Instantiates a ResNet18 network.

Parameters:
  • nclasses (int) – number of output classes

  • nf (int) – number of filters

Returns:

ResNet network