confidence_weights
ConfidenceWeights
¶
Bases: torch.nn.Module
Returns the max value along each row of the input, followed by an optional normalization function. The output of this can be used to weight classification losses by the "confidence" of the predictions.
Source code in pytorch_adapt\layers\confidence_weights.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
|
__init__(normalizer=None)
¶
Parameters:
Name | Type | Description | Default |
---|---|---|---|
normalizer |
Callable[[torch.Tensor], torch.Tensor]
|
A callable for normalizing
(e.g. min-max normalization) the weights.
If |
None
|
Source code in pytorch_adapt\layers\confidence_weights.py
17 18 19 20 21 22 23 24 25 26 |
|