towhee.models.cvnet.resnetΒΆ

Functions

get_trans_fun

Retrieves the transformation function by name.

Classes

BasicTransform

Basic transformation: 3x3, BN, ReLU, 3x3, BN.

BottleneckTransform

Bottleneck transformation: 1x1, BN, ReLU, 3x3, BN, ReLU, 1x1, BN.

GeneralizedMeanPooling

Applies a 2D power-average adaptive pooling over an input signal composed of several input planes. The function computed is: \(f(X) = pow(sum(pow(X, p)), 1/p)\) - At p = infinity, one gets Max Pooling - At p = 1, one gets Average Pooling The output is of size H x W, for any input size. The number of output features is equal to the number of input planes. :param output_size: the target output size of the image of the form H x W. Can be a tuple (H, W) or a single H for a square image H x H H and W can be either a int, or None which means the size will be the same as that of the input.

GeneralizedMeanPoolingP

Same, but norm is trainable

GlobalHead

ResBlock

Residual block: x + F(x).

ResNet

ResNet model.

ResStage

Stage of ResNet.

ResStemIN

ResNet stem for ImageNet: 7x7, BN, ReLU, MaxPool.