@@ -137,7 +137,7 @@ Each distance corresponds to a distance type. The type name and the correspondin
137
137
| Chebyshev | ` chebyshev(x, y) ` | ` max(abs(x - y)) ` |
138
138
| Minkowski | ` minkowski(x, y, p) ` | ` sum(abs(x - y).^p) ^ (1/p) ` |
139
139
| Hamming | ` hamming(k, l) ` | ` sum(k .!= l) ` |
140
- | Rogers-Tanimoto | ` rogerstanimoto(a, b) ` | ` 2(sum(a&!b) + sum(!a&b)) / (2(sum(a&!b) + sum(!a&b)) + sum(a&b) + sum(!a&!b)) ` |
140
+ | RogersTanimoto | ` rogerstanimoto(a, b) ` | ` 2(sum(a&!b) + sum(!a&b)) / (2(sum(a&!b) + sum(!a&b)) + sum(a&b) + sum(!a&!b)) ` |
141
141
| Jaccard | ` jaccard(x, y) ` | ` 1 - sum(min(x, y)) / sum(max(x, y)) ` |
142
142
| CosineDist | ` cosine_dist(x, y) ` | ` 1 - dot(x, y) / (norm(x) * norm(y)) ` |
143
143
| CorrDist | ` corr_dist(x, y) ` | ` cosine_dist(x - mean(x), y - mean(y)) ` |
@@ -146,12 +146,12 @@ Each distance corresponds to a distance type. The type name and the correspondin
146
146
| GenKLDivergence | ` gkl_divergence(x, y) ` | ` sum(p .* log(p ./ q) - p + q) ` |
147
147
| RenyiDivergence | ` renyi_divergence(p, q, k) ` | ` log(sum( p .* (p ./ q) .^ (k - 1))) / (k - 1) ` |
148
148
| JSDivergence | ` js_divergence(p, q) ` | ` KL(p, m) / 2 + KL(p, m) / 2 with m = (p + q) / 2 ` |
149
- | SpanNormDist | ` spannorm_dist(x, y) ` | ` max(x - y) - min(x - y ) ` |
149
+ | SpanNormDist | ` spannorm_dist(x, y) ` | ` max(x - y) - min(x - y) ` |
150
150
| BhattacharyyaDist | ` bhattacharyya(x, y) ` | ` -log(sum(sqrt(x .* y) / sqrt(sum(x) * sum(y))) ` |
151
151
| HellingerDist | ` hellinger(x, y) ` | ` sqrt(1 - sum(sqrt(x .* y) / sqrt(sum(x) * sum(y)))) ` |
152
152
| Haversine | ` haversine(x, y, r) ` | [ Haversine formula] ( https://en.wikipedia.org/wiki/Haversine_formula ) |
153
153
| Mahalanobis | ` mahalanobis(x, y, Q) ` | ` sqrt((x - y)' * Q * (x - y)) ` |
154
- | SqMahalanobis | ` sqmahalanobis(x, y, Q) ` | ` (x - y)' * Q * (x - y)` |
154
+ | SqMahalanobis | ` sqmahalanobis(x, y, Q) ` | ` (x - y)' * Q * (x - y) ` |
155
155
| MeanAbsDeviation | ` meanad(x, y) ` | ` mean(abs.(x - y)) ` |
156
156
| MeanSqDeviation | ` msd(x, y) ` | ` mean(abs2.(x - y)) ` |
157
157
| RMSDeviation | ` rmsd(x, y) ` | ` sqrt(msd(x, y)) ` |
@@ -194,9 +194,9 @@ julia> pairwise(Euclidean(1e-12), x, x)
194
194
195
195
## Benchmarks
196
196
197
- The implementation has been carefully optimized based on benchmarks. The script in ` benchmark/benchmarks.jl ` defines a benchmark suite
198
- for a variety of distances, under column-wise and pairwise settings.
199
-
197
+ The implementation has been carefully optimized based on benchmarks. The script in ` benchmark/benchmarks.jl ` defines a benchmark suite
198
+ for a variety of distances, under column-wise and pairwise settings.
199
+
200
200
Here are benchmarks obtained running Julia 0.6 on a computer with a quad-core Intel Core i5-2500K processor @ 3.3 GHz.
201
201
The tables below can be replicated using the script in ` benchmark/print_table.jl ` .
202
202
0 commit comments