OverviewFilesCommitsIssuesDocsReleasesPeers

opencog-matrix commits / 0d83040

Start work on marginals
0d83040f69283731e453f7bc0e62eb45527ae29e
by Linas Vepštas <linasvepstas@gmail.com> · 2025-02-01T19:41:57.000Z

Changed files (1) +39 -1

design/Design-similarity.md +39 -1
……@@ -119,4 +119,42 @@ Obviously, the above can be replaced by "any" query at all. The current
119119rules seem to require explicit variable declarations, so that the types
120120become visible for item (1).
121121
122For item (3),
122For item (3), the `'left-wildcard` method takes a single `ITEM` and
123returns
124```
125 (Edge (Predicate "word-pair")
126 (List (Any "left-wild") ITEM))
127```
128The obvious "solution" is to replace this with
129```
130 (Edge (Predicate "word-pair")
131 (List (Variable "$left") ITEM))
132```
133The preceeding questions need to be "is this really needed?" and "what
134is this used for?" The answer seems to be is that these are used for
135storing marginals, only.
136
137This then begs the question: "what do we want, for marginals"? Ther are
138several plausible answers. Consider the general tensor query:
139```
140 (Query
141 (VariableList VAR-1 VAR-2 ... VAR-N)
142 (AndLink PATTERN-TERM-1 PATTERN-TERM-2 ... PATTERN-TERM-K)
143 REWRITE-1
144 REWRITE-2
145 ...
146 REWRITE-M
147```
148One answer is to claim that one wants marginals for the search pattern,
149given by the `AndLink`. For N=2 variables, call them 'left' and 'right',
150there are only two marginals, obtained by plugging into search pattern.
151For larger N, there are N-factorial marginals.
152
153In this case, one asks "what's the point of the rewrites?". The answer
154here is that we actually want marginals on the rewrites, and not on the
155search pattern. For N=2 and M=1 we regain the original word-pair matrix.
156In that original matrix, the only rewrite was identical to the search
157pattern, thus a confusion about which is which.
158
159The rewrites provide an opportunity to specify exactly which marginals
160one is interested in. Thus, for example: