matchclot.embedding.models module
Summary
Classes:
Swap Noise module |
|
Single modality encoder MLP with dropout and stochastic feature augmentation (SFA) https://openaccess.thecvf.com/content/ICCV2021/papers /Li_A_Simple_Feature_Augmentation_for_Domain_Generalization_ICCV_2021_paper.pdf |
|
CLIP-inspired architecture |
Functions:
CLIP loss |
Reference
- class BatchSwapNoise(p)[source]
Bases:
ModuleSwap Noise module
- forward(x)[source]
Defines the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Moduleinstance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
-
training:
bool
- class Encoder(n_input, embedding_size, dropout_rates, dims_layers, swap_noise_ratio, noise_amount=0.0)[source]
Bases:
ModuleSingle modality encoder MLP with dropout and stochastic feature augmentation (SFA) https://openaccess.thecvf.com/content/ICCV2021/papers /Li_A_Simple_Feature_Augmentation_for_Domain_Generalization_ICCV_2021_paper.pdf
- forward(x)[source]
Defines the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Moduleinstance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
-
training:
bool
- class Modality_CLIP(Encoder, layers_dims, dropout_rates, dim_mod1, dim_mod2, output_dim, T, swap_rate_1=0.0, swap_rate_2=0.0, noise_amount=0.0)[source]
Bases:
ModuleCLIP-inspired architecture
- forward(features_first, features_second)[source]
Defines the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Moduleinstance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
-
training:
bool