You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
wasserstein and squared2wasserstein provide a unified and optimized interface for ot_cost. Hence all sources mu and targets nu that are supported by ot_cost can be used. This includes, e.g., pairs Normal, MvNormal, and DiscreteNonParametric distributions (from the Distributions package) for which a closed form solution exists for specific cost functions (and hence specific Wasserstein distances). The Wasserstein distance for a continuous univariate source distribution and an arbitrary univariate target distribution can be computed with numerical integration.
Currently, one has to pass Distributions as source and target and raw Vectors are not supported. However, you can use a DiscreteNonParametric distribution instead. You can construct them explicitly with DiscreteNonParametric(mu_vector, mu_probs) (where probably mu_probs are uniform probabilities fill(inv(length(mu_probs)), length(mu_probs))) or the convenience function discretemeasure by discretemeasure(mu_vector, mu_probs) where mu_probs can be omitted in the uniform case.
Sorry if this issue looks ridiculous.
What is the required type of the arguments 'mu' and 'nu' of the function
wasserstein()
?Is it also possible to pass two
Vector{Float64}
's (currently that seems to throw an error)?Many thanks!
The text was updated successfully, but these errors were encountered: