skada.deep.DANN

skada.deep.DANN(module, layer_name, reg=1, domain_classifier=None, num_features=None, domain_criterion=None, **kwargs)[source]

Domain-Adversarial Training of Neural Networks (DANN).

From [15].

Parameters:
moduletorch module (class or instance)

A PyTorch Module. In general, the uninstantiated class should be passed, although instantiated modules will also work.

layer_namestr

The name of the module's layer whose outputs are collected during the training.

regfloat, default=1

Regularization parameter.

domain_classifiertorch module, default=None

A PyTorch Module used to classify the domain. If None, a domain classifier is created following [1]_.

num_featuresint, default=None

Size of the input of domain classifier, e.g size of the last layer of the feature extractor. If domain_classifier is None, num_features has to be provided.

domain_criteriontorch criterion (class)

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

References

[15]

Yaroslav Ganin et. al. Domain-Adversarial Training of Neural Networks In Journal of Machine Learning Research, 2016.

Examples using skada.deep.DANN

Adversarial domain adaptation methods.

Adversarial domain adaptation methods.