skada.deep.CDAN

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

Conditional Domain Adversarial Networks (CDAN).

From [16].

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.

max_featuresint, default=4096

Maximum size of the input for the domain classifier. 4096 is the largest number of units in typical deep network according to [1]_.

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 embedding space e.g. the size of the output of layer_name. If domain_classifier is None, num_features has to be provided.

n_classesint, default None

Number of output classes. If domain_classifier is None, n_classes has to be provided.

domain_criteriontorch criterion (class)

The 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.