diff options
author | Rémi Flamary <remi.flamary@gmail.com> | 2016-10-24 15:36:16 +0200 |
---|---|---|
committer | Rémi Flamary <remi.flamary@gmail.com> | 2016-10-24 15:36:16 +0200 |
commit | 838708a0134ab8e0e0ba7ee01bd97e7aa39b23bb (patch) | |
tree | 38131877d09373144b716cf03af5d0a2f8e240c0 /ot/utils.py | |
parent | 04262dd46420304dd8d9bb01d37e4ceb3e44c11d (diff) |
add plot and utils functions
Diffstat (limited to 'ot/utils.py')
-rw-r--r-- | ot/utils.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/ot/utils.py b/ot/utils.py index 582c3ff..5feb4c6 100644 --- a/ot/utils.py +++ b/ot/utils.py @@ -3,6 +3,11 @@ import numpy as np from scipy.spatial.distance import cdist +def unif(n): + """ return a uniform histogram (simplex) """ + return np.ones((n,))/n + + def dist(x1,x2=None,metric='sqeuclidean'): """Compute distance between samples in x1 and x2""" if x2 is None: |