LinearClsHead¶
- class mmpretrain.models.heads.LinearClsHead(num_classes, in_channels, init_cfg={'layer': 'Linear', 'std': 0.01, 'type': 'Normal'}, **kwargs)[source]¶
Linear classifier head.
- Parameters:
num_classes (int) – Number of categories excluding the background category.
in_channels (int) – Number of channels in the input feature map.
loss (dict) – Config of classification loss. Defaults to
dict(type='CrossEntropyLoss', loss_weight=1.0)
.topk (int | Tuple[int]) – Top-k accuracy. Defaults to
(1, )
.cal_acc (bool) – Whether to calculate accuracy during training. If you use batch augmentations like Mixup and CutMix during training, it is pointless to calculate accuracy. Defaults to False.
init_cfg (dict, optional) – the config to control the initialization. Defaults to
dict(type='Normal', layer='Linear', std=0.01)
.