Skip to content

Commit 9ee87cb

Browse files
committed
Tentatively remove Wasserstein distance from the module.
1 parent 9893959 commit 9ee87cb

File tree

2 files changed

+1
-38
lines changed

2 files changed

+1
-38
lines changed

src/LSHFunctions.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ Exports
3838

3939
# Similarity functions, norms, inner products
4040
export cossim, inner_prod, ℓ1, ℓ2, ℓp, L1, L2, Lp, ℓ1_norm, ℓ2_norm,
41-
ℓp_norm, L1_norm, L2_norm, Lp_norm, jaccard, wasserstein_1d,
42-
wasserstein1_1d, wasserstein2_1d
41+
ℓp_norm, L1_norm, L2_norm, Lp_norm, jaccard
4342

4443
# Hash functions
4544
export SimHash, L1Hash, L2Hash, MIPSHash, SignALSH, MinHash,

src/similarities.jl

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -375,39 +375,3 @@ L1_norm(f, interval::LSHFunctions.RealInterval) = quadgk(x -> abs(f(x)), interva
375375

376376
@doc (@doc Lp_norm)
377377
L2_norm(f, interval::LSHFunctions.RealInterval) = quadgk(x -> abs2(f(x)), interval.lower, interval.upper)[1]
378-
379-
#====================
380-
1D Wasserstein distance
381-
====================#
382-
383-
@doc raw"""
384-
wasserstein_1d(f, g, p)
385-
wasserstein1_1d(f, g)
386-
wasserstein2_1d(f, g)
387-
emd(f, g)
388-
389-
Compute the order-``p`` Wasserstein distance between two probability distributions defined on the interval ``[-1,1]``.
390-
- `wasserstein1_1d(f,g) == emd(f,g) == wasserstein_1d(f, g, 1)`
391-
- `wasserstein2_1d(f,g) == wasserstein_1d(f, g, 2)`
392-
393-
# Arguments
394-
- `f` and `g`: two probability distributions defined on ``[-1,1]``.
395-
- `p::Real`: the order of Wasserstein distance to compute.
396-
"""
397-
function wasserstein_1d(f, g, p::Real)
398-
# For one-dimensional probability distributions, the Wasserstein distance has
399-
# the closed form
400-
#
401-
# ∫_0^1 |F^{-1}(x) - G^{-1}(x)|^p dx
402-
#
403-
# where F^{-1} and G^{-1} are the inverse c.d.f.s of f and g. We use this
404-
# formula to compute the distance between f and g.
405-
error("TODO")
406-
end
407-
408-
@doc (@doc wasserstein_1d)
409-
wasserstein1_1d(f, g) = wasserstein_1d(f, g, 1)
410-
emd = wasserstein1_1d
411-
412-
@doc (@doc wasserstein_1d)
413-
wasserstein2_1d(f, g) = wasserstein_1d(f, g, 2)

0 commit comments

Comments
 (0)