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
move implementations into type overloading (aka. functor) (#139)
* make evaluate a general API
* BhattacharyyaDist and HellingerDist
* Bregman
* Haversine
* SqMahalanobis and Mahalanobis
* metrics in metrics.jl
CorrDist is excluded from `UnionMetrics` since it's a simple wrap on CosineDist
* remove specification of pairwise and colwise on CorrDist
The previous specification is needed to pass a centralized input, now
we don't need it anymore
* metrics in wmetrics.jl
* colwise and pairwise
* update README.md
* update test
* rename metric_list to metrics
* revert auto-formatted spaces
changed parts:
* spaces after type annotation, e.g, `b::AbstractMatrix = a`
not changed parts:
* additional spaces at the end of line
* spaces between operations and comma, e.g., `a + b` and `(a, b)`
* update format
* rollback auto-format on whitespaces
* test if there are any ambiguities
This PR fixes all the ambiguities as a good start, future PRs may not
break this.
Copy file name to clipboardExpand all lines: README.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -54,12 +54,14 @@ Each distance corresponds to a *distance type*. You can always compute a certain
54
54
55
55
```julia
56
56
r =evaluate(dist, x, y)
57
+
r =dist(x, y)
57
58
```
58
59
59
60
Here, dist is an instance of a distance type. For example, the type for Euclidean distance is ``Euclidean`` (more distance types will be introduced in the next section), then you can compute the Euclidean distance between ``x`` and ``y`` as
60
61
61
62
```julia
62
63
r =evaluate(Euclidean(), x, y)
64
+
r =Euclidean()(x, y)
63
65
```
64
66
65
67
Common distances also come with convenient functions for distance evaluation. For example, you may also compute Euclidean distance between two vectors as below
0 commit comments