duq¶
- probly.method.duq(base: Predictor[In, Out], centroid_size: int = 256, length_scale: float = 0.1, gamma: float = 0.999) DUQPredictor[In, Out][source]¶
Replace the final classifier head with an RBF centroid head.
Based on [vASTG20].
- Parameters:
base – The base logit classifier whose final linear head is replaced.
centroid_size – Dimensionality of the per-class RBF centroids. Default is 256.
length_scale – RBF kernel length scale. Default is 0.1.
gamma – Exponential moving-average discount factor for updating the centroids. Default is 0.999.
- Returns:
The DUQ predictor.