1010# License: MIT License
1111
1212import numpy as np
13+ import warnings
14+
1315from .bregman import sinkhorn
1416from .lp import emd
1517from .utils import unif , dist , kernel
1618from .optim import cg
1719from .optim import gcg
18- import warnings
20+ from . deprecation import deprecated
1921
2022
2123def sinkhorn_lpl1_mm (a , labels_a , b , M , reg , eta = 0.1 , numItermax = 10 ,
@@ -632,6 +634,9 @@ def df(G):
632634 return G , L
633635
634636
637+ @deprecated ("The class OTDA is deprecated in 0.3.1 and will be "
638+ "removed in 0.5"
639+ "\n \t for standard transport use class EMDTransport instead." )
635640class OTDA (object ):
636641
637642 """Class for domain adaptation with optimal transport as proposed in [5]
@@ -758,10 +763,15 @@ def normalizeM(self, norm):
758763 self .M = np .log (1 + np .log (1 + self .M ))
759764
760765
766+ @deprecated ("The class OTDA_sinkhorn is deprecated in 0.3.1 and will be"
767+ " removed in 0.5 \n Use class SinkhornTransport instead." )
761768class OTDA_sinkhorn (OTDA ):
762769
763770 """Class for domain adaptation with optimal transport with entropic
764- regularization"""
771+ regularization
772+
773+
774+ """
765775
766776 def fit (self , xs , xt , reg = 1 , ws = None , wt = None , norm = None , ** kwargs ):
767777 """Fit regularized domain adaptation between samples is xs and xt
@@ -783,6 +793,8 @@ def fit(self, xs, xt, reg=1, ws=None, wt=None, norm=None, **kwargs):
783793 self .computed = True
784794
785795
796+ @deprecated ("The class OTDA_lpl1 is deprecated in 0.3.1 and will be"
797+ " removed in 0.5 \n Use class SinkhornLpl1Transport instead." )
786798class OTDA_lpl1 (OTDA ):
787799
788800 """Class for domain adaptation with optimal transport with entropic and
@@ -810,6 +822,8 @@ def fit(self, xs, ys, xt, reg=1, eta=1, ws=None, wt=None, norm=None,
810822 self .computed = True
811823
812824
825+ @deprecated ("The class OTDA_l1L2 is deprecated in 0.3.1 and will be"
826+ " removed in 0.5 \n Use class SinkhornL1l2Transport instead." )
813827class OTDA_l1l2 (OTDA ):
814828
815829 """Class for domain adaptation with optimal transport with entropic
@@ -837,6 +851,8 @@ def fit(self, xs, ys, xt, reg=1, eta=1, ws=None, wt=None, norm=None,
837851 self .computed = True
838852
839853
854+ @deprecated ("The class OTDA_mapping_linear is deprecated in 0.3.1 and will be"
855+ " removed in 0.5 \n Use class MappingTransport instead." )
840856class OTDA_mapping_linear (OTDA ):
841857
842858 """Class for optimal transport with joint linear mapping estimation as in
@@ -882,6 +898,8 @@ def predict(self, x):
882898 return None
883899
884900
901+ @deprecated ("The class OTDA_mapping_kernel is deprecated in 0.3.1 and will be"
902+ " removed in 0.5 \n Use class MappingTransport instead." )
885903class OTDA_mapping_kernel (OTDA_mapping_linear ):
886904
887905 """Class for optimal transport with joint nonlinear mapping
0 commit comments