62b40a9993e9ccca27d1677aa1294fff6246e904,ot/da.py,BaseTransport,fit,#BaseTransport#Any#Any#Any#Any#,1069
Before Change
// pairwise distance
self.Cost = dist(Xs, Xt, metric=self.metric)
if self.mode == "semisupervised":
if (ys is not None) and (yt is not None):
// assumes labeled source samples occupy the first rows
// and labeled target samples occupy the first columns
classes = np.unique(ys)
for c in classes:
ids = np.where(ys == c)
idt = np.where(yt == c)
// all the coefficients corresponding to a source sample
// and a target sample with the same label gets a 0
// transport cost
for j in idt[0]:
self.Cost[ids[0], j] = 0
else:
print("Warning: using unsupervised mode\
\nto use semisupervised mode, please provide ys and yt")
pass
// distribution estimation
self.mu_s = self.distribution_estimation(Xs)
self.mu_t = self.distribution_estimation(Xt)
// store arrays of samples
After Change
if (ys is not None) and (yt is not None):
if self.limit_max != np.infty:
self.limit_max = self.limit_max * np.max(self.Cost)
// assumes labeled source samples occupy the first rows
// and labeled target samples occupy the first columns
classes = np.unique(ys)
for c in classes:
idx_s = np.where((ys != c) & (ys != -1))
idx_t = np.where(yt == c)
In pattern: SUPERPATTERN
Frequency: 5
Non-data size: 6
Instances
Project Name: rflamary/POT
Commit Name: 62b40a9993e9ccca27d1677aa1294fff6246e904
Time: 2017-09-01
Author: stan.chambon@gmail.com
File Name: ot/da.py
Class Name: BaseTransport
Method Name: fit
Project Name: ray-project/ray
Commit Name: 244aafdcf89ae814975c8c4e3faf0bd4995c7878
Time: 2020-09-05
Author: sven@anyscale.io
File Name: rllib/utils/exploration/tests/test_curiosity.py
Class Name: OneHotWrapper
Method Name: observation
Project Name: rflamary/POT
Commit Name: d793f1f73e6f816458d8b307762675aa9fa84d22
Time: 2017-08-04
Author: stan.chambon@gmail.com
File Name: ot/da.py
Class Name: BaseTransport
Method Name: fit
Project Name: etal/cnvkit
Commit Name: 934291e74098fe8d09a528c95c043b43bcac9575
Time: 2016-02-22
Author: eric.talevich@gmail.com
File Name: cnvlib/antitarget.py
Class Name:
Method Name: get_background
Project Name: xinntao/BasicSR
Commit Name: ee1a026a7ad52bd8e807024e41d70276028c59e2
Time: 2020-11-27
Author: wxt1994@126.com
File Name: test_scripts/test_face_dfdnet.py
Class Name: FaceRestorationHelper
Method Name: get_face_landmarks_68