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
Copy file name to clipboardExpand all lines: README.md
+8-2Lines changed: 8 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -165,14 +165,20 @@ At the top of this hierarchy is an abstract class **PreMetric**, which is define
165
165
d(x, x) == 0 for all x
166
166
d(x, y) >= 0 for all x, y
167
167
168
-
**SemiMetric** is a abstract type that refines **PreMetric**. Formally, a *semi-metric* is a *pre-metric* that is also symmetric, as
168
+
**SemiMetric** is an abstract type that refines **PreMetric**. Formally, a *semi-metric* is a *pre-metric* that is also symmetric, as
169
169
170
170
d(x, y) == d(y, x) for all x, y
171
171
172
-
**Metric** is a abstract type that further refines **SemiMetric**. Formally, a *metric* is a *semi-metric* that also satisfies triangle inequality, as
172
+
**Metric** is an abstract type that further refines **SemiMetric**. Formally, a *metric* is a *semi-metric* that also satisfies triangle inequality, as
173
173
174
174
d(x, z) <= d(x, y) + d(y, z) for all x, y, z
175
175
176
+
**MinkowskiMetric** is an abstract type that encompasses a family of metrics defined by the formula
177
+
178
+
d(x, y) = sum(w .* (x - y) .^ p) ^ (1 / p)
179
+
180
+
where the `p` parameter defines the metric and `w` is a potential weight vector (all 1's by default).
181
+
176
182
This type system has practical significance. For example, when computing pairwise distances
177
183
between a set of vectors, you may only perform computation for half of the pairs, derive the
178
184
values immediately for the remaining half by leveraging the symmetry of *semi-metrics*. Note
0 commit comments