Skip to content

Commit fff2ca5

Browse files
Merge pull request #84 from antoinedemathelin/master
docs: Add doc ULSIF, RULSIF, IWN, IWC, PRED...
2 parents 4491aad + 77a8fb3 commit fff2ca5

36 files changed

+1638
-47
lines changed

.github/workflows/check-docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
run: |
1919
sudo apt install pandoc
2020
python -m pip install --upgrade pip
21-
pip install jinja2==3.0.3 sphinx numpydoc nbsphinx sphinx_gallery sphinx_rtd_theme ipython
21+
pip install jinja2==3.0.3 sphinx==4.4.0 numpydoc==1.2 nbsphinx==0.8.8 sphinx_gallery==0.10.1 sphinx_rtd_theme==1.0.0 ipython==8.0.1
2222
- name: Install adapt dependencies
2323
run: |
2424
python -m pip install --upgrade pip

.github/workflows/publish-doc-to-remote.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
run: |
1919
sudo apt install pandoc
2020
python -m pip install --upgrade pip
21-
pip install jinja2==3.0.3 sphinx numpydoc nbsphinx sphinx_gallery sphinx_rtd_theme ipython
21+
pip install jinja2==3.0.3 sphinx==4.4.0 numpydoc==1.2 nbsphinx==0.8.8 sphinx_gallery==0.10.1 sphinx_rtd_theme==1.0.0 ipython==8.0.1
2222
- name: Install adapt dependencies
2323
run: |
2424
python -m pip install --upgrade pip

adapt/feature_based/_cdan.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,9 @@ def _get_default_classifier(name=None, state=None):
3434
@make_insert_doc(["encoder"])
3535
class CDAN(BaseAdaptDeep):
3636
"""
37-
CDAN (Conditional Adversarial Domain Adaptation) is an
38-
unsupervised domain adaptation method on the model of the
37+
CDAN: Conditional Adversarial Domain Adaptation
38+
39+
CDAN is an unsupervised domain adaptation method on the model of the
3940
:ref:`DANN <adapt.feature_based.DANN>`. In CDAN the discriminator
4041
is conditioned on the prediction of the task network for
4142
source and target data. This should , in theory, focus the

adapt/feature_based/_mcd.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@
1414
@make_insert_doc(["encoder", "task"])
1515
class MCD(BaseAdaptDeep):
1616
"""
17-
MCD: Maximum Classifier Discrepancy is a feature-based domain adaptation
18-
method originally introduced for unsupervised classification DA.
17+
MCD: Maximum Classifier Discrepancy
18+
19+
MCD is a feature-based domain adaptation method originally introduced
20+
for unsupervised classification DA.
1921
2022
The goal of MCD is to find a new representation of the input features which
2123
minimizes the discrepancy between the source and target domains

adapt/feature_based/_mdd.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@
1414
@make_insert_doc(["encoder", "task"])
1515
class MDD(BaseAdaptDeep):
1616
"""
17-
MDD: Margin Disparity Discrepancy is a feature-based domain adaptation
18-
method originally introduced for unsupervised classification DA.
17+
MDD: Margin Disparity Discrepancy
18+
19+
MDD is a feature-based domain adaptation method originally introduced
20+
for unsupervised classification DA.
1921
2022
The goal of MDD is to find a new representation of the input features which
2123
minimizes the disparity discrepancy between the source and target domains

adapt/feature_based/_tca.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class TCA(BaseAdaptEstimator):
5050
5151
References
5252
----------
53-
.. [1] `[1] <https://www.cse.ust.hk/~qyang/Docs/2009/TCA.pdf>` S. J. Pan, \
53+
.. [1] `[1] <https://www.cse.ust.hk/~qyang/Docs/2009/TCA.pdf>`_ S. J. Pan, \
5454
I. W. Tsang, J. T. Kwok and Q. Yang. "Domain Adaptation via Transfer Component \
5555
Analysis". In IEEE transactions on neural networks 2010
5656
"""

adapt/feature_based/_wdgrl.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@
1313
@make_insert_doc(["encoder", "task", "discriminator"])
1414
class WDGRL(BaseAdaptDeep):
1515
"""
16-
WDGRL (Wasserstein Distance Guided Representation Learning) is an
17-
unsupervised domain adaptation method on the model of the
16+
WDGRL: Wasserstein Distance Guided Representation Learning
17+
18+
WDGRL is an unsupervised domain adaptation method on the model of the
1819
:ref:`DANN <adapt.feature_based.DANN>`. In WDGRL the discriminator
1920
is used to approximate the Wasserstein distance between the
2021
source and target encoded distributions in the spirit of WGAN.

adapt/instance_based/_balancedweighting.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class BalancedWeighting(BaseAdaptEstimator):
1010
"""
1111
BW : Balanced Weighting
1212
13-
Fit the estimator on source and target labeled data
13+
Fit the estimator :math:`h` on source and target labeled data
1414
according to the modified loss:
1515
1616
.. math::
@@ -26,7 +26,7 @@ class BalancedWeighting(BaseAdaptEstimator):
2626
2727
Parameters
2828
----------
29-
gamma : float
29+
gamma : float (default=0.5)
3030
ratio between 0 and 1 correspond to the importance
3131
given to the target labeled data. When `ratio=1`, the
3232
estimator is only fitted on target data. `ratio=0.5`

adapt/instance_based/_iwc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class IWC(BaseAdaptEstimator):
2828
2929
.. math::
3030
31-
w(x) = \frac{1}{P(x \in Source)} - 1
31+
w(x) = \\frac{1}{P(x \in Source)} - 1
3232
3333
Parameters
3434
----------

adapt/instance_based/_iwn.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,12 @@ def weighted_mmd(Xs, Xt, weights, gamma=1.):
4747
return mxx + myy -2*mxy
4848

4949

50-
@make_insert_doc(["estimator", "weighter"], supervised=True)
50+
@make_insert_doc(["estimator", "weighter"])
5151
class IWN(BaseAdaptDeep):
5252
"""
53-
IWN : Importance Weighting Network is an instance-based method for
54-
unsupervised domain adaptation<.
53+
IWN : Importance Weighting Network
54+
55+
IWN is an instance-based method for unsupervised domain adaptation.
5556
5657
The goal of IWN is to reweight the source instances in order to
5758
minimize the Maximum Mean Discreancy (MMD) between the reweighted
@@ -107,7 +108,7 @@ class IWN(BaseAdaptDeep):
107108
108109
References
109110
----------
110-
.. [1] `[1] <https://arxiv.org/pdf/2209.04215.pdff>`_ A. de Mathelin, F. Deheeger, \
111+
.. [1] `[1] <https://arxiv.org/pdf/2209.04215.pdf>`_ A. de Mathelin, F. Deheeger, \
111112
M. Mougeot and N. Vayatis "Fast and Accurate Importance Weighting for \
112113
Correcting Sample Bias" In ECML-PKDD, 2022.
113114
"""

0 commit comments

Comments
 (0)