Skip to content

Commit 66feea6

Browse files
committed
Drop support for ChebHash.
Remove ChebHash from the package in favor of better support for MonteCarloHash. Fixes #26.
1 parent fcd73f8 commit 66feea6

File tree

9 files changed

+6
-462
lines changed

9 files changed

+6
-462
lines changed

Manifest.toml

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
# This file is machine-generated - editing it directly is not advised
22

3-
[[AbstractFFTs]]
4-
deps = ["LinearAlgebra"]
5-
git-tree-sha1 = "051c95d6836228d120f5f4b984dd5aba1624f716"
6-
uuid = "621f4979-c628-5d54-868e-fcf4e3e8185c"
7-
version = "0.5.0"
8-
93
[[Arpack]]
104
deps = ["Arpack_jll", "Libdl", "LinearAlgebra"]
115
git-tree-sha1 = "2ff92b71ba1747c5fdd541f8fc87736d82f40ec9"
@@ -64,30 +58,12 @@ git-tree-sha1 = "f3464968c65fc78846dad1c038c474a2c39bbb23"
6458
uuid = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
6559
version = "0.25.0"
6660

67-
[[FFTW]]
68-
deps = ["AbstractFFTs", "FFTW_jll", "IntelOpenMP_jll", "Libdl", "LinearAlgebra", "MKL_jll", "Reexport"]
69-
git-tree-sha1 = "14536c95939aadcee44014728a459d2fe3ca9acf"
70-
uuid = "7a1cc6ca-52ef-59f5-83cd-3a7055c09341"
71-
version = "1.2.2"
72-
73-
[[FFTW_jll]]
74-
deps = ["Libdl", "Pkg"]
75-
git-tree-sha1 = "6c975cd606128d45d1df432fb812d6eb10fee00b"
76-
uuid = "f5851436-0d7a-5f13-b9de-f02708fd171a"
77-
version = "3.3.9+5"
78-
7961
[[FillArrays]]
8062
deps = ["LinearAlgebra", "Random", "SparseArrays"]
8163
git-tree-sha1 = "bf726ba7ce99e00d10bf63c031285fb9ab3676ae"
8264
uuid = "1a297f60-69ca-5386-bcde-b61e274b549b"
8365
version = "0.8.11"
8466

85-
[[IntelOpenMP_jll]]
86-
deps = ["Libdl", "Pkg"]
87-
git-tree-sha1 = "fb8e1c7a5594ba56f9011310790e03b5384998d6"
88-
uuid = "1d5cc7b8-4909-519e-a0f8-d0f5ad9712d0"
89-
version = "2018.0.3+0"
90-
9167
[[InteractiveUtils]]
9268
deps = ["Markdown"]
9369
uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
@@ -112,12 +88,6 @@ uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
11288
[[Logging]]
11389
uuid = "56ddb016-857b-54e1-b83d-db4d58db5568"
11490

115-
[[MKL_jll]]
116-
deps = ["IntelOpenMP_jll", "Libdl", "Pkg"]
117-
git-tree-sha1 = "0ce9a7fa68c70cf83c49d05d2c04d91b47404b08"
118-
uuid = "856f044c-d86e-5d09-b602-aeab76dc8ba7"
119-
version = "2020.1.216+0"
120-
12191
[[Markdown]]
12292
deps = ["Base64"]
12393
uuid = "d6f4376e-aef5-505a-96c1-9c027394607a"
@@ -182,12 +152,6 @@ uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb"
182152
deps = ["Serialization"]
183153
uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
184154

185-
[[Reexport]]
186-
deps = ["Pkg"]
187-
git-tree-sha1 = "7b1d07f411bc8ddb7977ec7f377b97b158514fe0"
188-
uuid = "189a3867-3050-52da-a836-e630ba90ab69"
189-
version = "0.2.0"
190-
191155
[[Rmath]]
192156
deps = ["Random", "Rmath_jll"]
193157
git-tree-sha1 = "86c5647b565873641538d8f812c04e4c9dbeb370"

Project.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ version = "0.1.2"
66
[deps]
77
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
88
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
9-
FFTW = "7a1cc6ca-52ef-59f5-83cd-3a7055c09341"
109
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
1110
Logging = "56ddb016-857b-54e1-b83d-db4d58db5568"
1211
Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a"
@@ -19,6 +18,5 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
1918
[compat]
2019
Distributions = "0.22, 0.23"
2120
Documenter = "0.24, 0.25"
22-
FFTW = "1.2"
2321
QuadGK = "2.3"
2422
julia = "1.3, 1.4, 1.5"

docs/src/full_api.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ Pages = ["similarities.jl"]
3838

3939
```@docs
4040
MonteCarloHash
41-
ChebHash
4241
```
4342

4443
## Miscellaneous

docs/src/function_hashing.md

Lines changed: 5 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ julia> hashfn(x -> 5x^3 - 2x^2 - 9x + 1)
2222
LSHFunctions can hash functions in any [``L^p_{\mu}(\Omega)`` function space](https://en.wikipedia.org/wiki/Lp_space) so long as ``\Omega`` has finite volume (i.e., as long as ``\int_{\Omega} d\mu(x) < +\infty``).
2323

2424
## Similarity statistics in function spaces
25+
2526
The LSHFunctions module currently supports hashing for the following similarity statistics in function spaces.
2627

2728
### ``L_{\mu}^p`` distance
@@ -39,49 +40,15 @@ The LSHFunctions module currently supports hashing for the following similarity
3940
When ``f`` and ``g`` are allowed to take on complex values, ``g(x)`` is replaced by ``\overline{g(x)}`` (the complex conjugate of ``g(x)``) in the formula above.
4041

4142
### Cosine similarity
43+
4244
```math
4345
\text{cossim}(f,g) = \frac{\left\langle f,g\right\rangle_{L_{\mu}^2}}{\|f\|_{L_{\mu}^2} \cdot \|g\|_{L_{\mu}^2}}
4446
```
4547

46-
## Function approximation-based hashing
48+
## Monte Carlo-based hashing
4749

4850
!!! warning "API subject to change"
49-
The API for both [`ChebHash`](@ref) and [`MonteCarloHash`](@ref), but especially the former, is being modified very quickly. As a result, the docs below may change radically for future versions of the LSHFunctions package.
50-
51-
Create a hash function for cosine similarity for functions in ``L^2([-1,1])``:
52-
53-
```
54-
julia> hashfn = ChebHash(cossim, 50; interval=@interval(-1 ≤ x ≤ 1));
55-
56-
julia> n_hashes(hashfn)
57-
50
58-
59-
julia> similarity(hashfn) == cossim
60-
true
61-
62-
julia> hashtype(hashfn)
63-
Bool
64-
```
65-
66-
Create a hash function for ``L^2`` distance defined over ``L^2([0,2\pi])``. Hash the functions `f(x) = cos(x)` and `f(x) = x/(2π)` using the returned [`ChebHash`](@ref):
67-
68-
```
69-
julia> hashfn = ChebHash(L2, 3; interval=@interval(0 ≤ x ≤ 2π));
70-
71-
julia> hashfn(cos)
72-
3-element Array{Int32,1}:
73-
3
74-
-1
75-
-2
76-
77-
julia> hashfn(x -> x/(2π))
78-
3-element Array{Int32,1}:
79-
0
80-
1
81-
0
82-
```
83-
84-
## Monte Carlo-based hashing
51+
The API for [`MonteCarloHash`](@ref) is still under heavy design. As a result, the docs below may change radically for future versions of the LSHFunctions package.
8552

8653
Create a hash function for cosine similarity for functions in ``L^2([-1,1])``:
8754

@@ -132,4 +99,5 @@ julia> length(hashfn.sample_points)
13299
```
133100

134101
## References
102+
135103
- Shand, William and Becker, Stephen. *Locality-sensitive hashing in function spaces*. [arXiv:2002.03909](https://arxiv.org/abs/2002.03909).

src/LSHFunctions.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ include(joinpath("hashes", "lshfunction.jl"))
3030
Function hashing
3131
========================#
3232

33-
include(joinpath("function_hashing", "chebhash.jl"))
3433
include(joinpath("function_hashing", "monte_carlo.jl"))
3534

3635
#========================
@@ -43,7 +42,7 @@ export cossim, inner_prod, ℓ1, ℓ2, ℓp, L1, L2, Lp, ℓ1_norm, ℓ2_norm,
4342

4443
# Hash functions
4544
export SimHash, L1Hash, L2Hash, MIPSHash, SignALSH, MinHash,
46-
LSHFunction, MonteCarloHash, ChebHash, SymmetricLSHFunction,
45+
LSHFunction, MonteCarloHash, SymmetricLSHFunction,
4746
AsymmetricLSHFunction
4847

4948
# Helper / utility functions for LSHFunctions

0 commit comments

Comments
 (0)