skada.deep.CDANLoss

class skada.deep.CDANLoss(domain_criterion=None)[source]

Conditional Domain Adversarial Networks (CDAN) loss.

This loss tries to minimize the divergence between features with adversarial method. The weights are updated to make harder to classify domains (i.e., remove domain-specific features) via multilinear conditioning that captures the crosscovariance between feature representations and classifier predictions From [16].

Parameters:
regfloat, default=1

Regularization parameter.

target_criteriontorch criterion (class), default=None

The initialized criterion (loss) used to compute the CDAN loss. If None, a BCELoss is used.

References

[16]

Mingsheng Long et. al. Conditional Adversarial Domain Adaptation In NeurIPS, 2016.

forward(y_s, y_pred_s, y_pred_t, domain_pred_s, domain_pred_t, features_s, features_t)[source]

Compute the domain adaptation loss