MultiLabelLinearClsHead¶
- class mmcls.models.heads.MultiLabelLinearClsHead(num_classes, in_channels, loss={'type': 'CrossEntropyLoss', 'use_sigmoid': True}, thr=None, topk=None, init_cfg={'layer': 'Linear', 'std': 0.01, 'type': 'Normal'})[源代码]¶
Linear classification head for multilabel task.
- 参数
loss (dict) – Config of classification loss. Defaults to dict(type=’CrossEntropyLoss’, use_sigmoid=True).
thr (float, optional) – Predictions with scores under the thresholds are considered as negative. Defaults to None.
topk (int, optional) – Predictions with the k-th highest scores are considered as positive. Defaults to None.
init_cfg (dict, optional) – The extra init config of layers. Defaults to use dict(type=’Normal’, layer=’Linear’, std=0.01).
提示
If both
thr
andtopk
are set, usethr` to determine positive predictions. If neither is set, use ``thr=0.5
as default.