OverviewFilesCommitsIssuesDocsReleasesPeers

opencog-atomese-simd commits / d38ec36

Fix for the embedding issue
d38ec36d1f6f97360883cc43447e5390543ae2a5
by Linas Vepštas <linasvepstas@gmail.com> · 2025-09-18T21:58:51.000Z

Changed files (1) +55 -0

Design-F.md +55 -0
……@@ -74,6 +74,8 @@ which would return the desired initial embedding. This works. Some
7474problems:
7575* Requires actually creating the Link. But this link is not really
7676 needed for any kind of long-term use/re-use.
77* But this is not really a problem, after all. Just use `ValueOf` or
78 `PureExec` to pipe Atoms into this. See hand-wringing agonizing below.
7779
7880A new-style OO API could be
7981```
……@@ -98,3 +100,56 @@ But this is terrible, because the URL is ugly.
98100
99101Overall: the OO API seems pointless and useless.
100102
103### Stateless Executation
104A meta-problem might be that we needs something in between `cog-execute!`
105and `cog-set-value!`. The problem with `cog-execute!` is it takes just
106one argument: the Atom to execute. Thus, a Link must be created to wrap
107arguments (e.g. `ExecutionOutputLink` as the prototypical, canonical
108example.) The `cog-set-value!` avoids this, as it specifies keys and
109arguments. The problem with it is that it is completely async: it has no
110return value; useing `cog-value` to read the result forces it to be
111stateful. Thus, a completely stateless intermediate form between
112`cog-execute!` and `cog-set-value!` is desirable. Or so it would seem.
113
114The backwards compat solution would be to change `Atom::setValue()` to
115not return void, and so on down the line. So `(cog-exeucte! (SetValue...))`
116would then return not VoidValue, but something meaningful...
117
118It seems like having this might make it easier to specify flows. For
119example, this would allow us to ditch things like `ExecutionOutputLink`.
120But is anything really gained, here? Analysis of the flow of control
121seems to get ... more complicated. Hmm. All this is very unclear.
122
123Conclusion: This is some kind og agony hand-wringing. We already have
124everything needed with things like `ValueOf` link, and the executable
125atoms that return `QueueValue` and whatnot. We can just pipe things.
126So the answer is: don't change anything. What we have already is just
127fine...
128
129### Embedding Flow.
130
131Another "fix" for the flow situation is to write
132```
133 (cog-execute!
134 (VectorEmbedLink
135 (ValueOf (Anchor "somewhere") (Predicate "some key"))
136 (NumberNode 768)
137 (TypeNode 'Float32Value)))
138```
139and so the generation of the initial embeddings becomes a flow.
140If its a query, then
141```
142 (cog-execute!
143 (VectorEmbedLink
144 (PureExec (QueryLink ...))
145 (NumberNode 768)
146 (TypeNode 'Float32Value)))
147```
148
149Then write to where the embedding will be stored:
150```
151 (cog-execute!
152 (SetValueLink
153 (Anchor "some place") (Predicate "some embedding key")
154 (VectorEmbedLink ...)))
155```