batch_spectral_loss
BatchSpectralLoss
¶
Bases: torch.nn.Module
Implementation of the loss in Transferability vs. Discriminability: Batch Spectral Penalization for Adversarial Domain Adaptation. The loss is the sum of the squares of the first k singular values.
Source code in pytorch_adapt\layers\batch_spectral_loss.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
|
__init__(k=1)
¶
Parameters:
Name | Type | Description | Default |
---|---|---|---|
k |
int
|
the number of singular values to include in the loss |
1
|
Source code in pytorch_adapt\layers\batch_spectral_loss.py
19 20 21 22 23 24 25 |
|