vivienseguy · GitHub

Conversation

@rflamary rflamary changed the title Vivien barycenters Free support barycenters

Jul 6, 2018

rflamary


##############################################################################
# Compute free support barycenter
# -------------

def barycenter(A, M, weights=None, verbose=False, log=False, solver='interior-point'):
"""Compute the entropic regularized wasserstein barycenter of distributions A
"""Compute the Wasserstein barycenter of distributions A

Parameters
----------
data_positions : list of (k_i,d) np.ndarray
Stop threshol on error (>0)
verbose : bool, optional
Print information along iterations
log : bool, optional

iter_count += 1

return X
import numpy as np
import scipy as sp
import scipy.sparse as sps
import ot
return b


def free_support_barycenter(measures_locations, measures_weights, X_init, b, weights=None, numItermax=100, stopThr=1e-6, verbose=False):
X_init = np.random.normal(0., 1., (k, d))
b = np.ones((k,)) / k

X = ot.lp.cvx.free_support_barycenter(measures_locations, measures_weights, X_init, b)

Vivien Seguy added 3 commits

July 9, 2018 16:49

Vivien Seguy

Vivien Seguy

Vivien Seguy

@rflamary

Labels

None yet

Read the original on github.com ↗