summaryrefslogtreecommitdiff
path: root/ot/da.py
diff options
context:
space:
mode:
authorSlasnista <stan.chambon@gmail.com>2017-08-23 15:09:08 +0200
committerSlasnista <stan.chambon@gmail.com>2017-08-23 15:09:08 +0200
commit09302239b3e4e1a90c1a4e2d7a85b0af86b01365 (patch)
treea25f0541d42cf9fb969bd7bc305b8480c360f53c /ot/da.py
parent326d163db029515c338a963978a5d95948f78c29 (diff)
added deprecation warning on old classes
Diffstat (limited to 'ot/da.py')
-rw-r--r--ot/da.py22
1 files changed, 20 insertions, 2 deletions
diff --git a/ot/da.py b/ot/da.py
index 3ccb1b3..8fa1895 100644
--- a/ot/da.py
+++ b/ot/da.py
@@ -10,12 +10,14 @@ Domain adaptation with optimal transport
# License: MIT License
import numpy as np
+import warnings
+
from .bregman import sinkhorn
from .lp import emd
from .utils import unif, dist, kernel
from .optim import cg
from .optim import gcg
-import warnings
+from .deprecation import deprecated
def sinkhorn_lpl1_mm(a, labels_a, b, M, reg, eta=0.1, numItermax=10,
@@ -632,6 +634,9 @@ def joint_OT_mapping_kernel(xs, xt, mu=1, eta=0.001, kerneltype='gaussian',
return G, L
+@deprecated("The class OTDA is deprecated in 0.3.1 and will be "
+ "removed in 0.5"
+ "\n\tfor standard transport use class EMDTransport instead.")
class OTDA(object):
"""Class for domain adaptation with optimal transport as proposed in [5]
@@ -758,10 +763,15 @@ class OTDA(object):
self.M = np.log(1 + np.log(1 + self.M))
+@deprecated("The class OTDA_sinkhorn is deprecated in 0.3.1 and will be"
+ " removed in 0.5 \nUse class SinkhornTransport instead.")
class OTDA_sinkhorn(OTDA):
"""Class for domain adaptation with optimal transport with entropic
- regularization"""
+ regularization
+
+
+ """
def fit(self, xs, xt, reg=1, ws=None, wt=None, norm=None, **kwargs):
"""Fit regularized domain adaptation between samples is xs and xt
@@ -783,6 +793,8 @@ class OTDA_sinkhorn(OTDA):
self.computed = True
+@deprecated("The class OTDA_lpl1 is deprecated in 0.3.1 and will be"
+ " removed in 0.5 \nUse class SinkhornLpl1Transport instead.")
class OTDA_lpl1(OTDA):
"""Class for domain adaptation with optimal transport with entropic and
@@ -810,6 +822,8 @@ class OTDA_lpl1(OTDA):
self.computed = True
+@deprecated("The class OTDA_l1L2 is deprecated in 0.3.1 and will be"
+ " removed in 0.5 \nUse class SinkhornL1l2Transport instead.")
class OTDA_l1l2(OTDA):
"""Class for domain adaptation with optimal transport with entropic
@@ -837,6 +851,8 @@ class OTDA_l1l2(OTDA):
self.computed = True
+@deprecated("The class OTDA_mapping_linear is deprecated in 0.3.1 and will be"
+ " removed in 0.5 \nUse class MappingTransport instead.")
class OTDA_mapping_linear(OTDA):
"""Class for optimal transport with joint linear mapping estimation as in
@@ -882,6 +898,8 @@ class OTDA_mapping_linear(OTDA):
return None
+@deprecated("The class OTDA_mapping_kernel is deprecated in 0.3.1 and will be"
+ " removed in 0.5 \nUse class MappingTransport instead.")
class OTDA_mapping_kernel(OTDA_mapping_linear):
"""Class for optimal transport with joint nonlinear mapping