OverviewFilesCommitsIssuesDocsReleasesPeers

opencog-agents commits / 1ce98d3

Try to scaffold the generation side
1ce98d338660d6d2322901c8c445b33420fcee6b
by Linas Vepštas <linasvepstas@gmail.com> · 2024-05-14T02:46:58.000Z

Changed files (4) +45 -12

README.md +1 -1
……@@ -14,7 +14,7 @@ But it was built as a batch system, training on large blobs of data,
1414moving from one training stage to the next. This turns out to be
1515unmanagable: its complicated, its fragile. It's hard to track status
1616and to run experiments. Hard to redo batch steps when bugs get fixed
17and system achitecture changes.
17and system architecture changes.
1818
1919Most importantly, the above is a roadblock to scaling: the core idea is
2020that the learning can be done recursively. But if the recursive steps
scm/pair-agent/Design-Generate.md +16 -11
……@@ -29,9 +29,10 @@ Ideas:
2929 requires:
3030* Allow dict lookup of words according to desired disjuncts.
3131
32OK, screw that. There are multiple design issues raised by above.
3233
33OK, screw that. The diary part ten is exploring this, here are the best
34ideas in summary form:
34## Simple chaining
35For quick bringup, lets just do simple chaining. Ideas in summary form:
3536
36371) Starting with a word A, use incoming set to randomly select some
3738subset of all possible edges. This will be called the "focus set" or the
……@@ -41,13 +42,14 @@ distribution, from which a rescaled uniform-random choice can be made.
4142
42432) Random sample N out of full incoming set.
4344
44Lets steam-process this: Query returns list of edges
45Lets stream-process this: Query returns list of edges
46```
4547 (Query (Variable "next") ; vardecl
4648 (EdgeLink (Predicate "ANY")
4749 (List (Word "start") (Variable "next"))))
48
50```
4951This returns a list (a short list? where do we plug in N to cap the size?)
50The list is actually a QueueValue.
52The list is actually a `QueueValue`.
5153
52543) Out of this queue Value, select one, with the proper weighting.
5355 Treating this as a collection of priors requires a sum over all elts
……@@ -55,13 +57,16 @@ The list is actually a QueueValue.
5557 to choose one for this weighted distribution. This requires a
5658 "non-local" RAM-walking sum.
5759
58A local way of doing this is to pick a min-MI cutoff, and selecting the
59first elt that is above the cutoff.
603a) Create a pipeline elt that takes list, adds the weights, then
61 selects N random items from that weighted list.
62
633b) A local way of doing this is to pick a min-MI cutoff, and selecting
64 the first elt that is above the cutoff.
6065
61A quasi-local way is to take the average of the first three elts,
62the first K elts, and then accept the first that is above this average.
63So the first K are always discarded, until the moving average is arrived
64at.
663c) A quasi-local way is to take the average of the first three elts,
67 the first K elts, and then accept the first that is above this average.
68 So the first K are always discarded, until the moving average is arrived
69 at.
6570
6671This needs:
67724) Atomese to fish out/Filter the MI from the correct location
scm/pair-agent/count-agent.scm +11 -0
……@@ -74,6 +74,7 @@
7474;
7575; Look at results. Poke around, look at counts.
7676(cog-report-counts)
77(cog-get-atoms 'Word)
7778(cog-execute! (ValueOf (Word "is") (Predicate "*-TruthValueKey-*")))
7879(cog-get-atoms 'Edge)
7980(cog-execute! (ValueOf
……@@ -82,6 +83,16 @@
8283
8384; Erase all words, so we can try again.
8485(extract-type 'WordNode)
86
87(cog-close storage-node)
88
89; Start all over again.
90(use-modules (opencog persist-rocks))
91(define storage-node (MonoStorageNode "monospace:///tmp/foo.rdb"))
92(cog-open storage-node)
93(load-atomspace)
94(cog-report-counts)
95
8596|#
8697
8798; --------------------------
scm/pair-agent/generate-agent.scm +17 -0
……@@ -0,0 +1,17 @@
1;
2; generate-agent.scm
3;
4; Scaffolding for bringup.
5;
6; Load everything.
7; guile -l run-common/cogserver-mst.scm
8;
9(use-modules (opencog) (opencog exec))
10(use-modules (opencog persist) (opencog persist-rocks))
11(use-modules (opencog nlp))
12(use-modules (opencog learn))
13(use-modules (opencog sensory))
14(use-modules (srfi srfi-1))
15
16
17