Skip to content

Commit 609e242

Browse files
Merge pull request #51 from antoinedemathelin/master
docs: Add examples on real datasets
2 parents 7a9c4ca + 35a9de6 commit 609e242

25 files changed

+2977
-78
lines changed

README.md

Lines changed: 200 additions & 48 deletions
Large diffs are not rendered by default.

adapt/instance_based/_wann.py

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
@make_insert_doc(["task", "weighter"], supervised=True)
1414
class 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, \
351 KB
Loading
594 KB
Loading
187 KB
Loading
311 KB
Loading
24.3 KB
Loading
85.7 KB
Loading
233 KB
Loading
44.3 KB
Loading

0 commit comments

Comments
 (0)