|
QDpy
|
Quality-diversity losses over visual augmentation invariances. More...
Go to the source code of this file.
Classes | |
| class | qdpy.vision.pretraining.InvarianceQDLoss |
| Keep a differentiable combined objective and its component losses. More... | |
Namespaces | |
| namespace | qdpy |
Functions | |
| qdpy.vision.pretraining.invariance_descriptors (clean, augmented) | |
| Describe each encoder by its response to the same augmentations. | |
| qdpy.vision.pretraining.visual_qd_loss (quality_losses, invariances, *, diversity_weight=1.) | |
| Add exponential pairwise similarity between invariance profiles to predictive loss. | |
Quality-diversity losses over visual augmentation invariances.
Definition in file pretraining.py.
| qdpy.vision.pretraining.invariance_descriptors | ( | clean, | |
| augmented ) |
Describe each encoder by its response to the same augmentations.
| clean | Encoder features of shape (members, batch, features). |
| augmented | Corresponding features of shape (members, augmentations, batch, features). |
Use aligned clean and transformed examples and keep gradients for each encoder.
Definition at line 31 of file pretraining.py.
| qdpy.vision.pretraining.visual_qd_loss | ( | quality_losses, | |
| invariances, | |||
| * | , | ||
| diversity_weight = 1. ) |
Add exponential pairwise similarity between invariance profiles to predictive loss.
| quality_losses | One scalar task loss per encoder, stacked into a tensor. |
| invariances | Invariance descriptors of shape (members, batch, augmentations). |
| diversity_weight | Nonnegative coefficient for the sum of pairwise penalties. |
Minimize proximity in invariance space while fitting the base task. Average cosine similarities over samples before comparing encoders. Each unordered pair contributes the exponential of its negative mean absolute gap across augmentations. A single encoder has a zero diversity penalty. Pass cross-entropy, contrastive, distillation, or combined base losses as the quality inputs.
Definition at line 48 of file pretraining.py.