Shortcuts

mmcls.models.StackedLinearClsHead

class mmcls.models.StackedLinearClsHead(num_classes: int, in_channels: int, mid_channels: Sequence, dropout_rate: float = 0.0, norm_cfg: Optional[Dict] = None, act_cfg: Dict = {'type': 'ReLU'}, **kwargs)[source]

Classifier head with several hidden fc layer and a output fc layer.

Parameters
  • num_classes (int) – Number of categories.

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

  • mid_channels (Sequence) – Number of channels in the hidden fc layers.

  • dropout_rate (float) – Dropout rate after each hidden fc layer, except the last layer. Defaults to 0.

  • norm_cfg (dict, optional) – Config dict of normalization layer after each hidden fc layer, except the last layer. Defaults to None.

  • act_cfg (dict, optional) – Config dict of activation function after each hidden layer, except the last layer. Defaults to use “ReLU”.