diff options
author | Rémi Flamary <remi.flamary@gmail.com> | 2017-07-11 12:05:07 +0200 |
---|---|---|
committer | Rémi Flamary <remi.flamary@gmail.com> | 2017-07-11 12:05:07 +0200 |
commit | 4efdda7853ab7c0eab17b947e28e416f2b16dc51 (patch) | |
tree | f3bb54cec4c32d6b57d6f7137648bd9af4730bd6 /ot/da.py | |
parent | 57330c5bd7dca7f315cec4c4f692737cae580ec6 (diff) |
add documentation
Diffstat (limited to 'ot/da.py')
-rw-r--r-- | ot/da.py | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -670,10 +670,16 @@ class OTDA(object): return xf[idx,:]+x-x0[idx,:] # aply the delta to the interpolation def normalizeM(self, norm): + """ Apply normalization to the loss matrix + + + Parameters + ---------- + norm : str + type of normalization from 'median','max','log','loglog' + """ - It may help to normalize the cost matrix self.M if there are numerical - errors during the sinkhorn based algorithms. - """ + if norm == "median": self.M /= float(np.median(self.M)) elif norm == "max": @@ -682,6 +688,7 @@ class OTDA(object): self.M = np.log(1 + self.M) elif norm == "loglog": self.M = np.log(1 + np.log(1 + self.M)) + class OTDA_sinkhorn(OTDA): |