ubrain 0.46.0.dev3__cp313-cp313-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. ubrain/__init__.py +51 -0
  2. ubrain/bodies/__init__.py +21 -0
  3. ubrain/bodies/client.cp313-win_amd64.pyd +0 -0
  4. ubrain/bodies/g1.cp313-win_amd64.pyd +0 -0
  5. ubrain/bodies/gym.cp313-win_amd64.pyd +0 -0
  6. ubrain/bodies/launch.cp313-win_amd64.pyd +0 -0
  7. ubrain/bodies/protocol.cp313-win_amd64.pyd +0 -0
  8. ubrain/brain.cp313-win_amd64.pyd +0 -0
  9. ubrain/card.cp313-win_amd64.pyd +0 -0
  10. ubrain/codecs.cp313-win_amd64.pyd +0 -0
  11. ubrain/contract.cp313-win_amd64.pyd +0 -0
  12. ubrain/datasheet.cp313-win_amd64.pyd +0 -0
  13. ubrain/extras/__init__.py +2 -0
  14. ubrain/extras/clip.cp313-win_amd64.pyd +0 -0
  15. ubrain/extras/hub.cp313-win_amd64.pyd +0 -0
  16. ubrain/face.cp313-win_amd64.pyd +0 -0
  17. ubrain/language.cp313-win_amd64.pyd +0 -0
  18. ubrain/observe.cp313-win_amd64.pyd +0 -0
  19. ubrain/portmap.cp313-win_amd64.pyd +0 -0
  20. ubrain/profiles/adapter.toml +42 -0
  21. ubrain/profiles/attender.toml +52 -0
  22. ubrain/profiles/chooser.toml +49 -0
  23. ubrain/profiles/companion.toml +122 -0
  24. ubrain/profiles/corticostriatal.toml +36 -0
  25. ubrain/profiles/explorer.toml +35 -0
  26. ubrain/profiles/holder.toml +30 -0
  27. ubrain/profiles/modulated.toml +107 -0
  28. ubrain/profiles/observer.toml +21 -0
  29. ubrain/profiles/player.toml +19 -0
  30. ubrain/profiles/rememberer.toml +33 -0
  31. ubrain/profiles/walker.toml +28 -0
  32. ubrain/profiles/whole.toml +139 -0
  33. ubrain/promoted/__init__.py +2 -0
  34. ubrain/promoted/adapt/__init__.py +1 -0
  35. ubrain/promoted/adapt/learner_adp.cp313-win_amd64.pyd +0 -0
  36. ubrain/promoted/assoc/__init__.py +1 -0
  37. ubrain/promoted/assoc/merge.cp313-win_amd64.pyd +0 -0
  38. ubrain/promoted/bg/__init__.py +1 -0
  39. ubrain/promoted/bg/striatum.cp313-win_amd64.pyd +0 -0
  40. ubrain/promoted/brace/__init__.py +1 -0
  41. ubrain/promoted/brace/learner.cp313-win_amd64.pyd +0 -0
  42. ubrain/promoted/cbl/__init__.py +1 -0
  43. ubrain/promoted/cbl/granule.cp313-win_amd64.pyd +0 -0
  44. ubrain/promoted/cbl/purkinje.cp313-win_amd64.pyd +0 -0
  45. ubrain/promoted/cls/__init__.py +1 -0
  46. ubrain/promoted/cls/hrr.cp313-win_amd64.pyd +0 -0
  47. ubrain/promoted/control/__init__.py +1 -0
  48. ubrain/promoted/control/salience.cp313-win_amd64.pyd +0 -0
  49. ubrain/promoted/cortex/__init__.py +1 -0
  50. ubrain/promoted/cortex/hebb.cp313-win_amd64.pyd +0 -0
  51. ubrain/promoted/dstr/__init__.py +1 -0
  52. ubrain/promoted/dstr/gate.cp313-win_amd64.pyd +0 -0
  53. ubrain/promoted/dstr/replay_trace.cp313-win_amd64.pyd +0 -0
  54. ubrain/promoted/dstr/tag_credit.cp313-win_amd64.pyd +0 -0
  55. ubrain/promoted/ec/__init__.py +1 -0
  56. ubrain/promoted/ec/codes.cp313-win_amd64.pyd +0 -0
  57. ubrain/promoted/embody/__init__.py +1 -0
  58. ubrain/promoted/embody/brain.cp313-win_amd64.pyd +0 -0
  59. ubrain/promoted/embody/forward.cp313-win_amd64.pyd +0 -0
  60. ubrain/promoted/epi/__init__.py +1 -0
  61. ubrain/promoted/epi/store.cp313-win_amd64.pyd +0 -0
  62. ubrain/promoted/hippo/__init__.py +1 -0
  63. ubrain/promoted/hippo/hrr_seq.cp313-win_amd64.pyd +0 -0
  64. ubrain/promoted/lang/__init__.py +1 -0
  65. ubrain/promoted/lang/memory.cp313-win_amd64.pyd +0 -0
  66. ubrain/promoted/lang/settle.cp313-win_amd64.pyd +0 -0
  67. ubrain/promoted/mn/__init__.py +1 -0
  68. ubrain/promoted/mn/store_mn.cp313-win_amd64.pyd +0 -0
  69. ubrain/promoted/rehearse/__init__.py +1 -0
  70. ubrain/promoted/rehearse/config_reh.cp313-win_amd64.pyd +0 -0
  71. ubrain/promoted/way/__init__.py +1 -0
  72. ubrain/promoted/way/record.cp313-win_amd64.pyd +0 -0
  73. ubrain/promoted/way/stage.cp313-win_amd64.pyd +0 -0
  74. ubrain/regions.cp313-win_amd64.pyd +0 -0
  75. ubrain/route.cp313-win_amd64.pyd +0 -0
  76. ubrain/state.cp313-win_amd64.pyd +0 -0
  77. ubrain/ubi.cp313-win_amd64.pyd +0 -0
  78. ubrain/variants/large.toml +17 -0
  79. ubrain/variants/small.toml +15 -0
  80. ubrain/variants/standard.toml +12 -0
  81. ubrain/way.cp313-win_amd64.pyd +0 -0
  82. ubrain/wiring.cp313-win_amd64.pyd +0 -0
  83. ubrain-0.46.0.dev3.dist-info/METADATA +170 -0
  84. ubrain-0.46.0.dev3.dist-info/RECORD +88 -0
  85. ubrain-0.46.0.dev3.dist-info/WHEEL +5 -0
  86. ubrain-0.46.0.dev3.dist-info/licenses/LICENSE-BINARY +35 -0
  87. ubrain-0.46.0.dev3.dist-info/licenses/NOTICE +10 -0
  88. ubrain-0.46.0.dev3.dist-info/top_level.txt +1 -0
ubrain/__init__.py ADDED
@@ -0,0 +1,51 @@
1
+ """ubrain -- Untrained Brain: never trained, always learning.
2
+
3
+ A modality-general brain that learns from experience by local plasticity. Plug in
4
+ any AI encoder as its senses and any body as its interface.
5
+
6
+ from ubrain import Brain
7
+ brain = Brain() # the whole brain (a preview, 0.28)
8
+ brain.attach("sense", "vision", codec=camera) # streams by port class
9
+ brain.attach("reward"); brain.attach("action", n=4)
10
+ action = brain.tick({"sense.vision": picture, "reward": r})["action"]
11
+
12
+ from ubrain import Brain, profile # a circuit: the experts' layer
13
+ brain = Brain(profile("walker"), manifest)
14
+ actions = brain.tick({"proprio": ..., "tone": False, "goal": (0.5, 0.0, 0.0)})
15
+
16
+ Pre-release (0.46.0.dev3; codecs and their certificates since 0.3, the hippocampal
17
+ episode and the `observer` profile since 0.4, CLIP as the `vision` extra since 0.5,
18
+ the `explorer` profile and recognising senses since 0.6, the memory system -- the
19
+ cortical slow store, replay into it, the `rememberer` profile -- since 0.7, working
20
+ memory -- the prefrontal buffer, rehearsal, the `holder` profile -- since 0.8,
21
+ noticing and switching -- the salience gate, the mode controller, consolidation on
22
+ idle, the `attender` profile -- since 0.9, episodic control -- the hippocampal store
23
+ that acts, the hand-over to the striatum, the `chooser` profile -- since 0.10, the hubs
24
+ -- the thalamic relay, acetylcholine, noradrenaline and serotonin as scalars on existing
25
+ knobs, the `modulated` profile -- since 0.11, walking adaptation -- one learning rate or
26
+ two, the after-effect, savings and spontaneous recovery, the `adapter` profile -- since
27
+ 0.12, a Gymnasium game as a body -- `ubrain.bodies.gym`, the `game` extra -- since 0.13, a
28
+ brain's state saved and loaded, observation and health, the datasheet, channel kinds
29
+ checked against ports -- the interface specification's core documents -- since 0.14,
30
+ the striatum valuing a situation code conditioned by a goal code, the `corticostriatal`
31
+ profile -- since 0.23, the whole brain with no wiring, `Brain()`, streams attached by port
32
+ class, named variants -- since 0.28): a
33
+ generic brain -- regions with typed ports, the wiring as a dataflow -- running two anatomies on two bodies with no brain code between
34
+ them: `walker` (the G1, contract 1.0 over protocol 0.3) and `player` (any body
35
+ that shows a situation and pays a reward: a bandit, or a Gymnasium game through
36
+ ubrain.bodies.gym). The laws behind every region are in The Untrained Brain Series,
37
+ Volume 1; how this package is built, in Volume 2.
38
+ """
39
+
40
+ from ubrain.brain import Brain
41
+ from ubrain.language import Language
42
+ from ubrain.contract import (CONTRACT_VERSION, Channel, Manifest, act_03, manifest_from_hello_03,
43
+ senses_from_state_03)
44
+ from ubrain.wiring import Wiring, load, profile
45
+ from ubrain.codecs import Certificate, Codec, FrozenCodes, GaussianCodes, Sense, certify
46
+
47
+ __version__ = "0.46.0.dev3"
48
+
49
+ __all__ = ["Brain", "Language", "Channel", "Manifest", "Wiring", "CONTRACT_VERSION", "load", "profile",
50
+ "Codec", "FrozenCodes", "GaussianCodes", "Sense", "Certificate", "certify",
51
+ "manifest_from_hello_03", "senses_from_state_03", "act_03", "__version__"]
@@ -0,0 +1,21 @@
1
+ """Bodies: the client side of a body that runs in its own process.
2
+
3
+ A body (a simulated robot, a game) runs as a server in its own environment and
4
+ speaks the tick bridge's protocol over TCP. ubrain never imports a simulator; it
5
+ talks to the server:
6
+
7
+ from ubrain.bodies import BodyClient, start_body
8
+ proc, port = start_body(gallery=True, head_camera=True) # the MuJoCo G1
9
+ body = BodyClient("127.0.0.1", port)
10
+ manifest = manifest_from_hello_03(body.hello)
11
+
12
+ `client.py` and `protocol.py` are copied byte for byte from the MuJoCo body's own
13
+ package (bodies/mujoco/body in the ubrain repository); they need only the standard
14
+ library.
15
+ """
16
+
17
+ from ubrain.bodies.client import BodyClient, decode_image
18
+ from ubrain.bodies.launch import find_body, free_port, kill_tree, start_body, start_body_for
19
+
20
+ __all__ = ["BodyClient", "decode_image", "start_body", "start_body_for", "find_body", "free_port",
21
+ "kill_tree"]
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1,2 @@
1
+ """Codec extras: wrappers for frozen AI models, each behind its own pip extra so the
2
+ brain itself never needs torch. `pip install ubrain[vision]` -> ubrain.extras.clip."""
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1,42 @@
1
+ # The adapter: the walker that also adapts its walk. A sustained push
2
+ # fixed to the pelvis heading turns the walking body; the cerebellum learns a
3
+ # counter-turn on the yaw-rate command from the sensed turn (the torso gyro's z, its
4
+ # climbing fibre). When the push stops, the learned counter-turn is the after-effect.
5
+ # Two learning rates with retention (Smith 2006) give savings and spontaneous
6
+ # recovery; one rate gives neither (the two-rate adaptation law). The walker's two regions are
7
+ # unchanged: with no correction learned, this is the walker tick for tick.
8
+ #
9
+ # `clamp` is the APPLICATION's channel (the experimenter's error clamp, a flag:
10
+ # Manifest.with_channels(Channel("clamp", "flag"))); absent from the senses, it is
11
+ # down and the cerebellum learns.
12
+
13
+ [brain]
14
+ name = "adapter"
15
+ contract = "1.0"
16
+
17
+ [regions."cerebellum.forward"] # as the walker
18
+ d_g = 2048
19
+ s = 128
20
+ eta = 0.5
21
+
22
+ [regions."cerebellum.brace"]
23
+ tau = 0.9
24
+ eta = 0.3
25
+
26
+ [regions."cerebellum.adapt"] # two rates, the measured constants per tick (40 ticks a stride):
27
+ arm = "dual" # b_f 0.007, a_f 0.9^(1/40), b_s 0.0008, a_s 0.995^(1/40)
28
+ # ("single": one rate, eta 0.005); axis 2 is the G1's
29
+ # gyro z in proprio, slot 2 the walk's yaw rate
30
+
31
+ [inputs]
32
+ "cerebellum.forward.proprio" = "proprio"
33
+ "cerebellum.forward.command" = "goal" # the efference copy: the goal, as the walker
34
+ # (the adaptation was measured without a forward model)
35
+ "cerebellum.brace.proprio" = "proprio"
36
+ "cerebellum.brace.cue" = "tone"
37
+ "cerebellum.adapt.proprio" = "proprio" # the sensed turn after last tick's command
38
+ "cerebellum.adapt.clamp" = "clamp"
39
+
40
+ [outputs]
41
+ walk = "goal + cerebellum.brace + cerebellum.adapt" # the goal, the counter-move, the counter-turn
42
+ offsets = "zero"
@@ -0,0 +1,52 @@
1
+ # The attender: a body with a plugged-in sense that NOTICES. Each item seen is judged
2
+ # against the last few it saw by the salience network's novelty statistic (1 - the
3
+ # largest cosine), whose null is exact: the threshold is derived so that a
4
+ # fresh item is mistaken for a familiar one at the false-alarm rate alpha. Novel items
5
+ # are written into the hippocampal episode; familiar ones are skipped (a gate on the
6
+ # write, the gate's law: a trade of load against coverage). A novel item is also a
7
+ # DEMAND on the mode controller (the network triangle): the system plans and
8
+ # stays in executive mode while novel items keep coming, and falls back to the default
9
+ # mode when nothing new is pending. Its first idle tick ends the episode, which is
10
+ # REPLAYED into the cortex under fresh index keys -- consolidation when idle, the
11
+ # default mode's job (consolidation by replay, timed by the default mode).
12
+ #
13
+ # The derived threshold assumes codes that look like random directions in the
14
+ # workspace (white codes, as the sense prepares them). A codec whose items crowd a cone
15
+ # or a low-rank subspace makes fresh items look familiar: certify() the codec first.
16
+
17
+ [brain]
18
+ name = "attender"
19
+ contract = "1.0"
20
+
21
+ [regions."salience.gate"]
22
+ memory = "trace" # a fading trace a brain could have (certified on its law, D.1); since 0.25
23
+ lam = 0.95 # its fade per item
24
+ alpha = 0.05 # P(a fresh item judged familiar): the threshold is derived from it
25
+
26
+ [regions."modes.controller"]
27
+ arm = "triangle" # plan iff a demand is pending (always_cen, always_dmn, coin: the comparisons)
28
+ policy = "interrupt" # a surprise (none is wired here) abandons the chunk
29
+ k = 4 # executive ticks per demand: attending, before idling is possible
30
+
31
+ [regions."hippocampus.episode"]
32
+ slots = 64
33
+
34
+ [regions."cortex.store"] # one tick is one event: gamma 1.0 forgets nothing
35
+ gamma = 1.0
36
+ replay_eta = 1.0
37
+
38
+ [inputs]
39
+ "salience.gate.item" = "camera" # a codec channel: plug a Sense in
40
+ "modes.controller.novel" = "salience.gate.novel" # a novel item is a demand
41
+ "hippocampus.episode.item" = "salience.gate.passed" # novel items only
42
+ "hippocampus.episode.recall" = "recall" # an event: which slot of the episode
43
+ "hippocampus.episode.boundary" = "modes.controller.idle" # default mode: the episode ends, replayed
44
+ "cortex.store.replay" = "hippocampus.episode.replay"
45
+ "cortex.store.recall" = "recollect" # an event: which consolidated memory
46
+
47
+ [outputs]
48
+ memory = "hippocampus.episode.recalled"
49
+ remembered = "hippocampus.episode.index"
50
+ recollection = "cortex.store.recalled"
51
+ recollected = "cortex.store.index"
52
+ mode = "modes.controller.mode" # 1 executive, 0 default mode
@@ -0,0 +1,49 @@
1
+ # The chooser: the player (the striatum) with an episodic memory that acts first, and
2
+ # a hand-over between them -- the complementary learning system as a controller. Every
3
+ # (situation, action, outcome) is bound into one decaying hippocampal store; at a
4
+ # decision each action's recalled outcome is read and the best taken, one-shot
5
+ # (memory is ahead early, where the striatum's table has barely moved). But the
6
+ # store's votes sit in the crosstalk of every other pair it holds, and the striatum
7
+ # overtakes it late where that crosstalk or its forgetting wins (the crossover law of
8
+ # episodic control). So memory acts only while it can tell its arms apart -- its votes'
9
+ # top-two margin above its own crosstalk scale ||x|| sqrt(2/d), read off the store with
10
+ # no estimate in it --
11
+ # and the striatum acts otherwise. Both learn from every outcome, on the action actually
12
+ # taken, crediting every choice since the last outcome (a bandit: one; a maze: the
13
+ # episode's).
14
+ #
15
+ # What the criterion is NOT (derived, and measured so): it measures separability,
16
+ # not reliability. The store's margin grows as it fills, so memory's share of decisions
17
+ # RISES even where the table has overtaken it; the hand-over tracks the better pure
18
+ # controller within a derived shortfall, and an oracle that knew both curves would do
19
+ # better. The same body runs on `player` (striatum alone) for the comparison.
20
+
21
+ [brain]
22
+ name = "chooser"
23
+ contract = "1.0"
24
+
25
+ [regions."hippocampus.episodic_control"] # the measured store: d 256, decay 0.995 per outcome
26
+ d = 256
27
+ gamma = 0.995
28
+ kappa = 1.0 # the measured convention: act above one sigma of crosstalk (omit: always act)
29
+
30
+ [regions."basal_ganglia.striatum"] # the player's setting: eta 0.1, values from 0.5
31
+ eta = 0.1
32
+ q0 = 0.5
33
+ credit = "episode" # every choice since the last outcome (end-of-episode credit)
34
+
35
+ [regions."control.handover"] # memory's action when it acted, the striatum's otherwise
36
+
37
+ [inputs]
38
+ "hippocampus.episodic_control.state" = "situation" # an event: which situation this is
39
+ "hippocampus.episodic_control.reward" = "reward" # the outcome of what was taken before it
40
+ "hippocampus.episodic_control.taken" = "control.handover.choice" # last tick's action, whoever chose it
41
+ "basal_ganglia.striatum.state" = "situation"
42
+ "basal_ganglia.striatum.reward" = "reward"
43
+ "basal_ganglia.striatum.taken" = "control.handover.choice"
44
+ "basal_ganglia.striatum.inhibit" = "hippocampus.episodic_control.confident" # memory acts: the race is held
45
+ "control.handover.memory" = "hippocampus.episodic_control.choice"
46
+ "control.handover.habit" = "basal_ganglia.striatum.choice"
47
+
48
+ [outputs]
49
+ action = "control.handover.choice"
@@ -0,0 +1,122 @@
1
+ # The companion: the whole brain in a walking body that notices, remembers, sleeps on
2
+ # it and chooses -- the explorer's cerebellum under the attender's memory system, with
3
+ # the striatum behind it (apps/gallery_companion, 2026-10-26). Nothing here is new
4
+ # machinery: every region is certified on its own; this wiring is what puts them
5
+ # together on one body for days.
6
+ #
7
+ # - The two cerebellar regions calibrate the frozen gait and brace on a cue (walker).
8
+ # - What the camera's sense delivers is JUDGED by the salience gate against the last few
9
+ # items (novelty, the exact null) and its verdict is an output (`novel`), and a novel
10
+ # item is a demand on the mode controller (the triangle): the system attends while
11
+ # new things keep coming and falls back to the default mode when nothing is pending.
12
+ # Unlike the attender, the gate does NOT stand before the episode: the camera's items
13
+ # are written directly, and the application's event segmentation (the same picture
14
+ # recognised on steady glances in a row) decides what counts as seen. Measured
15
+ # 2026-10-26 (stage 0): with the gate before the episode, 6 of 12 pictures were judged
16
+ # familiar and never written -- the gate's threshold is derived for white codes, and
17
+ # CLIP's centred codes are correlated; the false-familiar rate was 0.5 against alpha
18
+ # 0.05. That is a finding for the engine (the gate's null on real codes), not a knob
19
+ # to turn here; the scoreboard checks `novel` against the law so the miss stays
20
+ # visible. An idle tick does NOT end the episode either: a
21
+ # day in the gallery is one episode, holding the order things were seen in, and it
22
+ # ends when the person says `sleep` (the `boundary` event) -- then it is REPLAYED
23
+ # into the cortex under fresh index keys, the day consolidated at night (measured
24
+ # 2026-10-26: with the idle boundary every glance-burst of k = 4 ticks emptied the
25
+ # episode, and nothing could be asked about the day).
26
+ # - The striatum learns, from a reward the person gives, what to do at a situation (the
27
+ # picture it stands at).
28
+ #
29
+ # Recall is BY INDEX: a cue names a slot of the episode or the n-th consolidated memory
30
+ # (the cortex's `cue` port reads a KEY, not an item's content). Content-addressed
31
+ # questions ("after the dog?") are the application's two steps over the brain's own
32
+ # answers: recall every slot, find the dog, ask the next. The person's words reach the
33
+ # brain as pictures (CLIP text snapped to the image vocabulary) in the app; no `said`
34
+ # channel is wired yet.
35
+
36
+ [brain]
37
+ name = "companion"
38
+ contract = "1.0"
39
+
40
+ [regions."cerebellum.forward"] # as the walker
41
+ d_g = 2048
42
+ s = 128
43
+ eta = 0.5
44
+
45
+ [regions."cerebellum.brace"]
46
+ tau = 0.9
47
+ eta = 0.3
48
+
49
+ [regions."salience.gate"]
50
+ memory = "trace" # a fading trace a brain could have (certified on its law, D.1); since 0.25
51
+ lam = 0.95 # its fade per item
52
+ alpha = 0.05 # P(a fresh item judged familiar): the threshold is derived from it
53
+
54
+ [regions."modes.controller"]
55
+ arm = "triangle" # plan iff a demand is pending
56
+ policy = "interrupt"
57
+ k = 4 # executive ticks per demand
58
+
59
+ [regions."hippocampus.episode"]
60
+ slots = 64
61
+
62
+ [regions."hippocampus.episode@route"] # a second ordered episode: the route (rung 5, 2026-10-27).
63
+ slots = 64 # Its items are skills taken and things seen, in order, from a
64
+ # joint vocabulary; "go to the X" is its recall, replayed
65
+
66
+ [regions."prefrontal.buffer"] # working memory: goals held while walking (rung 6, 2026-10-27).
67
+ gamma_m = 0.75 # the measured decay per write (the holder's): about seven held
68
+ eta = 1.0
69
+ slots = 16
70
+
71
+ [regions."thalamus.relay"] # attention among things in view (rung 7, 2026-10-27): the view's
72
+ routes = 6 # fixations are the routes (both halves x three squares); a route
73
+ alpha = 0.05 # opens when its content matches the thing sought (`seek`), and
74
+ # every open route is read off the bus (`attention`)
75
+
76
+ [regions."cortex.store"] # one tick is one event at 50 Hz: gamma 1.0 forgets nothing
77
+ gamma = 1.0
78
+ replay_eta = 1.0
79
+
80
+ [regions."basal_ganglia.striatum"]
81
+ eta = 0.1
82
+ q0 = 0.5
83
+
84
+ [inputs]
85
+ "cerebellum.forward.proprio" = "proprio"
86
+ "cerebellum.forward.command" = "goal"
87
+ "cerebellum.brace.proprio" = "proprio"
88
+ "cerebellum.brace.cue" = "tone"
89
+ "salience.gate.item" = "camera" # a codec channel: plug CLIP in
90
+ "modes.controller.novel" = "salience.gate.novel" # a novel item is a demand
91
+ "hippocampus.episode.item" = "camera" # every item seen (the app segments events)
92
+ "hippocampus.episode.recall" = "recall" # an event: which slot of the episode
93
+ "hippocampus.episode.boundary" = "boundary" # `sleep`: the day's episode ends, replayed
94
+ "cortex.store.replay" = "hippocampus.episode.replay"
95
+ "cortex.store.recall" = "recollect" # an event: which consolidated memory
96
+ "hippocampus.episode@route.item" = "route_item" # a skill taken, or a thing seen (a codec channel)
97
+ "hippocampus.episode@route.recall" = "recall_route" # an event: which step of the route
98
+ "hippocampus.episode@route.boundary" = "route_boundary" # an event: the route ends (a new trip)
99
+ "prefrontal.buffer.item" = "goal_item" # a goal: a thing, through the camera's sense
100
+ "prefrontal.buffer.recall" = "recall_goal" # an event: which goal of the list
101
+ "prefrontal.buffer.clear" = "goal_clear" # an event: a new list
102
+ "thalamus.relay.routes" = "routes" # the fixations' codes, R x d (the app's crops)
103
+ "thalamus.relay.goal" = "seek" # the thing sought: its code (a trip's target)
104
+ "basal_ganglia.striatum.state" = "situation" # the picture it stands at
105
+ "basal_ganglia.striatum.reward" = "reward" # the person's good / bad
106
+
107
+ [outputs]
108
+ walk = "goal + cerebellum.brace"
109
+ offsets = "zero"
110
+ memory = "hippocampus.episode.recalled"
111
+ remembered = "hippocampus.episode.index"
112
+ recollection = "cortex.store.recalled"
113
+ recollected = "cortex.store.index"
114
+ mode = "modes.controller.mode" # 1 executive, 0 default mode
115
+ novel = "salience.gate.novel" # the gate's verdict on this tick's item (1 novel)
116
+ action = "basal_ganglia.striatum.choice"
117
+ route_memory = "hippocampus.episode@route.recalled"
118
+ route_remembered = "hippocampus.episode@route.index"
119
+ goal_memory = "prefrontal.buffer.recalled"
120
+ goal_remembered = "prefrontal.buffer.index"
121
+ attention = "thalamus.relay.reads" # every open route's read off the bus
122
+ opened = "thalamus.relay.open" # which routes the gate opened
@@ -0,0 +1,36 @@
1
+ # The corticostriatal path: the striatum valuing a situation CODE, never an index. A
2
+ # body's situation arrives as a code on the sphere (a vector channel, or a sense's
3
+ # workspace code); the striatum reads it through the cerebellum's granule expansion
4
+ # (1024 units, the 64 largest kept, centred, unit norm) and learns a value per action
5
+ # by the three-factor rule, the expansion as the eligibility. The goal, a code too,
6
+ # conditions the values by binding: the same situation under another goal is another
7
+ # point of the expansion, so values that reverse with the goal are learned apart.
8
+ #
9
+ # The law (ubrain.datasheet.value_law) gives the expected reward of the greedy choice
10
+ # for ANY feature map on a sample of the world -- this expansion, the raw code, the
11
+ # binned table an application would otherwise build -- so which reads best is computed
12
+ # before a run, and the answer depends on the world: the raw code where the reward is
13
+ # linear in the code, the expansion where it is not, a table of the prototypes where
14
+ # the situations are a few clean ones. While `explore` is up the actions are taken in
15
+ # turn (every action learned alike, the schedule the law was measured under); while it
16
+ # is down the largest value is taken.
17
+
18
+ [brain]
19
+ name = "corticostriatal"
20
+ contract = "1.0"
21
+
22
+ [regions."basal_ganglia.striatum"] # the measured setting: eta 0.1, 64 of 1024, the goal bound
23
+ eta = 0.1
24
+ features = "expansion" # or "raw": the code itself, read linearly
25
+ d_g = 1024
26
+ s = 64
27
+ context = "bind" # or "sum": the goal superposed (shares what the goals share)
28
+
29
+ [inputs]
30
+ "basal_ganglia.striatum.situation" = "situation" # a code: a vector channel or a sense
31
+ "basal_ganglia.striatum.context" = "goal" # the goal, a code of the situation's width
32
+ "basal_ganglia.striatum.reward" = "reward" # the outcome of the choice before it
33
+ "basal_ganglia.striatum.explore" = "explore" # a flag: take the actions in turn
34
+
35
+ [outputs]
36
+ action = "basal_ganglia.striatum.choice"
@@ -0,0 +1,35 @@
1
+ # The explorer: the walker that also remembers what it sees. A legged body with a
2
+ # head camera; a plugged-in vision codec (CLIP) turns what the camera looks at into
3
+ # codes, and the hippocampus writes them into one episode as it walks, slot by slot;
4
+ # a cue recalls a slot. The walker's two cerebellar regions are unchanged.
5
+
6
+ [brain]
7
+ name = "explorer"
8
+ contract = "1.0"
9
+
10
+ [regions."cerebellum.forward"] # as the walker
11
+ d_g = 2048
12
+ s = 128
13
+ eta = 0.5
14
+
15
+ [regions."cerebellum.brace"]
16
+ tau = 0.9
17
+ eta = 0.3
18
+
19
+ [regions."hippocampus.episode"]
20
+ slots = 64
21
+
22
+ [inputs]
23
+ "cerebellum.forward.proprio" = "proprio"
24
+ "cerebellum.forward.command" = "goal"
25
+ "cerebellum.brace.proprio" = "proprio"
26
+ "cerebellum.brace.cue" = "tone"
27
+ "hippocampus.episode.item" = "camera" # a codec channel: plug CLIP in
28
+ "hippocampus.episode.recall" = "recall" # the app's cue
29
+ "hippocampus.episode.boundary" = "boundary"
30
+
31
+ [outputs]
32
+ walk = "goal + cerebellum.brace"
33
+ offsets = "zero"
34
+ memory = "hippocampus.episode.recalled"
35
+ remembered = "hippocampus.episode.index"
@@ -0,0 +1,30 @@
1
+ # The holder: a body with a plugged-in sense whose items are HELD in working memory
2
+ # -- the prefrontal active buffer, persistent activity -- and recalled by position on
3
+ # a cue. Each item seen is bound to its position's role and added to one decaying
4
+ # vector; with no CA3 behind it, the buffer holds about seven items at a plausible
5
+ # decay (working memory's count law, on the event clock). On an idle event the
6
+ # buffer rehearses its schedule's next item; rehearsal changes WHICH items are held,
7
+ # never how many (the rehearsal law: a full cycle restores the presentation's profile).
8
+ # A clear event starts a new list.
9
+
10
+ [brain]
11
+ name = "holder"
12
+ contract = "1.0"
13
+
14
+ [regions."prefrontal.buffer"] # the measured working-memory decay and rehearsal setting
15
+ gamma_m = 0.75 # per WRITE event (a presentation or a rehearsal), not per tick:
16
+ eta = 1.0 # a tick that writes nothing does not age the buffer
17
+ slots = 16 # positions (roles); an item past the last is dropped
18
+ schedule = "cycle" # none, cycle, oldest, newest, random (the measured schedules)
19
+ n_rehearse = 16 # idle rehearsals per list, then the schedule is spent
20
+ m = 3 # the oldest/newest schedules' item count
21
+
22
+ [inputs]
23
+ "prefrontal.buffer.item" = "camera" # a codec channel: plug a Sense in
24
+ "prefrontal.buffer.recall" = "recall" # an event: which position to recall (0 the first)
25
+ "prefrontal.buffer.idle" = "idle" # an event: a free moment, rehearse
26
+ "prefrontal.buffer.clear" = "clear" # an event: the list ends
27
+
28
+ [outputs]
29
+ memory = "prefrontal.buffer.recalled" # the recalled code
30
+ remembered = "prefrontal.buffer.index" # which vocabulary item it is
@@ -0,0 +1,107 @@
1
+ # The modulated brain: the hubs on a brain that notices, remembers and chooses. Nothing
2
+ # here is new machinery: each neuromodulator is ONE SCALAR on a knob an existing region
3
+ # already has, and the thalamus is a gate on a route.
4
+ #
5
+ # - The thalamus relays R incoming streams (`routes`, one workspace code per route) to a
6
+ # shared bus, opening a route only when its content matches the goal held elsewhere
7
+ # (the relay's gate). Gating removes the crosstalk of irrelevant routes and risks
8
+ # closing the target's own: it pays with many routes and a goal that matches, and
9
+ # costs with few routes or a goal that barely matches (the relay's law).
10
+ # - Noradrenaline sets the salience gate's criterion from the recent rate of JUDGED
11
+ # surprise: the threshold that errs least at that rate, for the world the gate judges
12
+ # (M known codes, repeats at noise sigma; exact). Slow adaptation pays after the
13
+ # novelty rate changes; on a stationary stream it costs a little; and fast adaptation
14
+ # RUNS AWAY -- the level counts surprise its own threshold decides -- to judging
15
+ # nothing novel (noradrenaline's law). Hence eta 0.02, not 0.1.
16
+ # - Acetylcholine splits each event's plasticity in the cortex: novel items encoded at
17
+ # a = 0.8, one earlier experience -- as the hippocampus holds it (hippocampus.replay) -- replayed
18
+ # at 0.2 on every event -- graded, where the
19
+ # binary mode switch (arm = "binary", idle = modes.controller.idle) encodes nothing
20
+ # when idle and replays only then; graded recalls both recent and older experience
21
+ # better wherever the two differ (acetylcholine's law).
22
+ # - Serotonin is the striatum's patience: a choice's eligibility decays by
23
+ # exp(-1/tau_hat) per tick until its outcome, tau_hat the running mean time between
24
+ # decisions. Less patience moves choice toward small-soon rewards by the race's fixed
25
+ # point; scaling patience to the usual trial time pays where the option it moves
26
+ # toward is the better one and costs where it turns impulsive (serotonin's law).
27
+ #
28
+ # The gate judges against a KNOWN set (`known`, taught by the body, never judged;
29
+ # remember = false), the world the noradrenaline criterion is certified in; the
30
+ # criterion's d is the camera sense's workspace width and must match it. Dopamine is
31
+ # the striatum's own reward-prediction error, as before.
32
+
33
+ [brain]
34
+ name = "modulated"
35
+ contract = "1.0"
36
+
37
+ [regions."thalamus.relay"]
38
+ routes = 4 # R streams arrive as a 4 x d batch (one workspace code per route)
39
+ alpha = 0.05 # an unrelated route slips through with probability 0.05 (the null's quantile)
40
+
41
+ [regions."neuromodulator.noradrenaline"] # before the gate: its level is read this tick
42
+ d = 256 # the camera sense's workspace width
43
+ M = 64 # known codes the gate judges against
44
+ sigma = 3.0 # the noise a familiar thing is seen again under (the first measured setting)
45
+ eta = 0.02 # slow: pays after a change, never runs away (0: a fixed criterion)
46
+ level = 0.1 # the novelty rate the world had
47
+
48
+ [regions."salience.gate"]
49
+ memory = "window" # the noradrenaline world keeps the exact window: its laws on the trace are
50
+ # not certified yet
51
+ remember = false # judged against the known set only
52
+ alpha = 0.05 # the threshold until noradrenaline sets it (it does, every tick)
53
+
54
+ [regions."modes.controller"]
55
+ arm = "triangle" # a novel item is a demand: plan iff one is pending
56
+ k = 4
57
+
58
+ [regions."neuromodulator.acetylcholine"] # before the cortex
59
+ arm = "graded"
60
+ idle_p = 0.2 # the tonic level a = 1 - idle_p = 0.8, the busy fraction
61
+
62
+ [regions."hippocampus.replay"] # before the cortex: what the cortex replays is what it still holds
63
+ d_h = 8192 # the trace's own width: a replay is only as good as this read of it
64
+ gamma_h = 0.995 # per item recorded
65
+
66
+ [regions."cortex.store"]
67
+ gamma = 0.94 # per event (the slower measured decay): right when one tick is one
68
+ # event; a body ticking at 50 Hz wants gamma near 1 (rememberer)
69
+
70
+ [regions."neuromodulator.serotonin"] # before the striatum
71
+ tau = 4.0 # the usual time between decisions to start from (ticks)
72
+ kappa = 0.02 # how fast it follows the time decisions actually take (0: fixed)
73
+
74
+ [regions."basal_ganglia.striatum"]
75
+ eta = 0.1
76
+ q0 = 0.5
77
+
78
+ [inputs]
79
+ "thalamus.relay.routes" = "routes" # R workspace codes, one per route
80
+ "thalamus.relay.goal" = "goal" # the goal the routes are matched to
81
+ "thalamus.relay.read" = "attend" # an event: which route to read off the bus
82
+ "neuromodulator.noradrenaline.novel" = "salience.gate.novel" # last tick's verdict (recurrent)
83
+ "neuromodulator.noradrenaline.novelty" = "salience.gate.novelty" # ... and whether an item arrived
84
+ "salience.gate.item" = "camera" # a codec channel: plug a Sense in
85
+ "salience.gate.know" = "known" # codes taught as familiar
86
+ "salience.gate.theta" = "neuromodulator.noradrenaline.theta"
87
+ "modes.controller.novel" = "salience.gate.novel"
88
+ "hippocampus.replay.item" = "salience.gate.passed" # the hippocampus records what the cortex encodes
89
+ "hippocampus.replay.encoding" = "neuromodulator.acetylcholine.level"
90
+ "cortex.store.item" = "salience.gate.passed" # novel items, encoded at a
91
+ "cortex.store.key" = "hippocampus.replay.key" # ... under the key the hippocampus gives them
92
+ "cortex.store.replay" = "hippocampus.replay.replay" # one earlier experience, as the hippocampus holds it
93
+ "cortex.store.replay_key" = "hippocampus.replay.replay_key" # ... rewritten under its own key at 1 - a
94
+ "cortex.store.encoding" = "neuromodulator.acetylcholine.level"
95
+ "cortex.store.recall" = "recollect" # an event: which encoded memory
96
+ "neuromodulator.serotonin.state" = "situation" # a decision: the time since the last one
97
+ "basal_ganglia.striatum.state" = "situation"
98
+ "basal_ganglia.striatum.reward" = "reward"
99
+ "basal_ganglia.striatum.patience" = "neuromodulator.serotonin.patience"
100
+
101
+ [outputs]
102
+ workspace = "thalamus.relay.bus"
103
+ attended = "thalamus.relay.read"
104
+ recollection = "cortex.store.recalled"
105
+ recollected = "cortex.store.index"
106
+ mode = "modes.controller.mode"
107
+ action = "basal_ganglia.striatum.choice"
@@ -0,0 +1,21 @@
1
+ # The observer: a body with a plugged-in sense (a camera through CLIP, a microphone,
2
+ # a text stream) whose items the hippocampus writes into one episode, slot by slot,
3
+ # and recalls by slot on a cue. What it recalls is a code of the sense's vocabulary,
4
+ # so the body (or the app) can say WHAT was seen. Its accuracy is the sense's
5
+ # certificate: ubrain.certify(codec, sample, d).
6
+
7
+ [brain]
8
+ name = "observer"
9
+ contract = "1.0"
10
+
11
+ [regions."hippocampus.episode"]
12
+ slots = 64
13
+
14
+ [inputs]
15
+ "hippocampus.episode.item" = "camera" # a codec channel: plug a Sense in
16
+ "hippocampus.episode.recall" = "recall" # an event: which slot to recall
17
+ "hippocampus.episode.boundary" = "boundary" # an event: the episode ends
18
+
19
+ [outputs]
20
+ memory = "hippocampus.episode.recalled" # the recalled code
21
+ remembered = "hippocampus.episode.index" # which vocabulary item it is
@@ -0,0 +1,19 @@
1
+ # The player: a body that shows a situation and pays a reward (a bandit, a game).
2
+ # The striatum learns a value per (situation, action) from each outcome and
3
+ # releases actions by the Go race. No cerebellum, no walking: the same Brain, a
4
+ # different anatomy, and not one line of brain code changed for it.
5
+
6
+ [brain]
7
+ name = "player"
8
+ contract = "1.0"
9
+
10
+ [regions."basal_ganglia.striatum"] # the measured setting: eta 0.1, values from 0.5
11
+ eta = 0.1
12
+ q0 = 0.5
13
+
14
+ [inputs]
15
+ "basal_ganglia.striatum.state" = "situation" # an event: which situation this is
16
+ "basal_ganglia.striatum.reward" = "reward" # the outcome of the last action
17
+
18
+ [outputs]
19
+ action = "basal_ganglia.striatum"