1313@make_insert_doc (["task" , "weighter" ], supervised = True )
1414class WANN (BaseAdaptDeep ):
1515 """
16- WANN: Weighting Adversarial Neural Network is an instance-based domain adaptation
16+ WANN : Weighting Adversarial Neural Network is an instance-based domain adaptation
1717 method suited for regression tasks. It supposes the supervised setting where some
1818 labeled target data are available.
1919
@@ -22,10 +22,11 @@ class WANN(BaseAdaptDeep):
2222 Y-discrepancy distance between source and target distributions
2323
2424 WANN involves three networks:
25- - the weighting network which learns the source weights.
26- - the task network which learns the task.
27- - the discrepancy network which is used to estimate a distance
28- between the reweighted source and target distributions: the Y-discrepancy
25+
26+ - the weighting network which learns the source weights.
27+ - the task network which learns the task.
28+ - the discrepancy network which is used to estimate a distance
29+ between the reweighted source and target distributions: the Y-discrepancy
2930
3031 Parameters
3132 ----------
@@ -52,18 +53,18 @@ class WANN(BaseAdaptDeep):
5253
5354 history_ : dict
5455 history of the losses and metrics across the epochs.
55-
56+
5657 Examples
5758 --------
58- from adapt.utils import make_regression_da
59- from adapt.instance_based import WANN
60- Xs, ys, Xt, yt = make_regression_da()
61- model = WANN(Xt=Xt[:10], yt=yt[:10], random_state=0)
62- model.fit(Xs, ys, epochs=100, verbose=0)
63- model.score(Xt, yt)
59+ >>> from adapt.utils import make_regression_da
60+ >>> from adapt.instance_based import WANN
61+ >>> Xs, ys, Xt, yt = make_regression_da()
62+ >>> model = WANN(Xt=Xt[:10], yt=yt[:10], random_state=0)
63+ >>> model.fit(Xs, ys, epochs=100, verbose=0)
64+ >>> model.score(Xt, yt)
6465 1/1 [==============================] - 0s 106ms/step - loss: 0.1096
65- 0.10955706238746643
66-
66+ 0.10955706238746643
67+
6768 References
6869 ----------
6970 .. [1] `[1] <https://arxiv.org/pdf/2006.08251.pdf>`_ A. de Mathelin, \
0 commit comments