OverviewFilesCommitsIssuesDocsReleasesPeers

opencog-sensory commits / 918bc72

Clustering
918bc72765d37e5208121c89f9f1d58258609155
by Linas Vepstas <linas@linas.org> · 2026-01-13T04:29:30.000Z

Changed files (1) +31 -8

DesignLearn-A.md +31 -8
……@@ -204,20 +204,43 @@ observed, i.e. "in practice")
204204Now, cluster them "by similarity". One of the easiest ways fo doing this
205205is by cosine-similarity. Cosine similarity requires vectors; where do
206206the vectors come from? They arise entirely naturally, in many ways. For
207example, consider all jigsaws that have the label "A" for the center
208vertex; these will have a large variety of labels "p,q,r..." on the
209connectors. How many are there? Say there are `N(A | p,q,r...)` of
210these. If we hold "A" fixed, while allowing "p,q,r..." to vary, this
211forms a vector! The ket `|p,q,r,...)` is the basis elt of the vector.
212Suppose the central vertex is labelled by "B": then `N(B | p,q,r...)`
207example, consider all jigsaws that have the label $A$ for the center
208vertex; these will have a large variety of labels $p,q,r...$ on the
209connectors. How many are there? Say there are $N(A | p,q,r...)$ of
210these. If we hold $A$ fixed, while allowing $p,q,r...$ to vary, this
211forms a vector! The ket $|p,q,r,...)$ is the basis elt of the vector.
212Suppose the central vertex is labelled by $B$: then $N(B | p,q,r...)$
213213is another vector, and the dot product is easy:
214```
214$
215215 A . B = Sum_{p,q,r..} N(A | p,q,r...) N(B | p,q,r...)
216```
216$
217217In practice, (i.e. experimentally measured) the dot products are
218218gaussian distributed, i.e. the data is distributed uniformly on a very
219219high dimensional sphere.
220220
221### Clustering
222Having a bizzillion points uniformly distributed on a high dimensional
223sphere is interesting but useless. The first thing we want to do is
224dimensional reduction by clustering. There are surely 101 different
225clustering algos. Pick one; pick several.
226
227Consider K-means. Take the high-dim sphere, sprinkle K random points
228on it, and assign vectors to the closest one. Duh. That is, each
229vertex label in the set {A, B, ...} is assigned to one of K different
230clusters.
231
232Unfortunately, this K-means clustering is horrble and ugly, because
233although it reduced the bras $(A|$ to a small number, it did not reduce
234the kets $|p,q,r...)$, of which there are still a gazzilion. Well,
235sort-of. Given that each p,q,r,... is a vertex indicator plus a sex
236label, K-means clustering of the bras will give $K^m$ kets, where $m$ is
237the mean number of connectors on a jigsaw. In total, then, there are
238$K^{m+1}$ such collections.
239
240Whatever. There are nicer clustering algos (which are more complex) that
241can maybe do a better job. That's not the point.
242
243### Axioms!
221244
222245
223246