Shortcuts

CSRAClsHead

class mmpretrain.models.heads.CSRAClsHead(num_classes, in_channels, num_heads, lam, init_cfg={'layer': 'Linear', 'std': 0.01, 'type': 'Normal'}, **kwargs)[source]

Class-specific residual attention classifier head.

Please refer to the Residual Attention: A Simple but Effective Method for Multi-Label Recognition (ICCV 2021) for details.

Parameters:
  • num_classes (int) – Number of categories.

  • in_channels (int) – Number of channels in the input feature map.

  • num_heads (int) – Number of residual at tensor heads.

  • loss (dict) – Config of classification loss.

  • lam (float) – Lambda that combines global average and max pooling scores.

  • init_cfg (dict, optional) – The extra init config of layers. Defaults to use dict(type='Normal', layer='Linear', std=0.01).

forward(feats)[source]

The forward process.

pre_logits(feats)[source]

The process before the final classification head.

The input feats is a tuple of tensor, and each tensor is the feature of a backbone stage. In CSRAClsHead, we just obtain the feature of the last stage.

Read the Docs v: stable
Versions
latest
stable
mmcls-1.x
mmcls-0.x
dev
Downloads
epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.