One learning module, one process — a cortical column with a mailbox.
The process is deliberately thin: matching_step, send_out_vote,
receive_votes and the rest are callbacks on a pure module
(Monty.Frameworks.Models.AbstractMontyClasses.LearningModule), and the
order in which they are called belongs to Monty.Runtime.Step, not here.
Keeping the algorithm out of the GenServer is what makes the column testable twice over: directly as a function, and through the process for the things only a process has — isolation, restart, mailbox ordering.
The client API below is the only way in, so call sites read as
LearningModuleServer.matching_step(server, percepts, ctx) and every entry
point carries a typespec.
Summary
Functions
Records whether this step's observation reached the module.
Returns a specification to start this module under a supervisor.
Drops what the module accumulated, keeping what it learned.
Forgets what the module concluded, keeping what it believes.
Drops the hypotheses of a module the experiment does not supervise.
Records which objects the graph a training episode built came from.
The module's top-down output, or nil.
The long-term memory this module holds, or :none.
Whether the last buffered observation was one this module processed.
Asks the module a question about its state, and answers only the answer.
Sends what this module believes, for the vote round to combine.
Tells the module whether this episode trains or evaluates.
Names this episode's object without emptying the module's history.
Records which object the module's sensor is on this step.
Names the object this episode is about, as the experiment knows it.
Times the module out without asking it to reconsider.
The module's own state, for tests and the run inspector.
Monty's _pass_target_info_to_model: the conclusion an experiment states.
Folds the episode into long-term memory, if it was a training episode.
Settles what the vote round left this module believing.
Checks the module's terminal condition and replies with what it concluded.
Types
@type percepts() :: [Monty.Cmp.Message.t()]
@type server() :: GenServer.server()
@type vote() :: term()
Functions
Records whether this step's observation reached the module.
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec clear_buffers(server()) :: :ok
Drops what the module accumulated, keeping what it learned.
What a run without episode boundaries asks of its modules when the object
under the sensor changes: Monty's _reset_modules_buffers.
@spec clear_conclusion(server()) :: :ok
Forgets what the module concluded, keeping what it believes.
@spec clear_hypotheses(server()) :: :ok
Drops the hypotheses of a module the experiment does not supervise.
@spec exploratory_step(server(), percepts(), Monty.Context.t()) :: :ok
@spec fixme_update_ground_truth(server()) :: :ok
Records which objects the graph a training episode built came from.
@spec get_output(server()) :: Monty.Cmp.Message.t() | nil
The module's top-down output, or nil.
Read at the start of a step; the coordinator decides whether it is delivered (the receiver must also have seen a sensor percept).
@spec graph_memory(server()) :: Monty.Frameworks.Models.GraphMatching.GraphMemory.t() | :none
The long-term memory this module holds, or :none.
A training episode's memory is handed to the next one, and the module is what holds it — asked here rather than read off the state, because only the module knows where in its state the memory is.
@spec matching_step(server(), percepts(), Monty.Context.t()) :: :ok
Whether the last buffered observation was one this module processed.
@spec propose_goals(server()) :: [Monty.Cmp.Goal.t()]
@spec propose_region(server()) :: Monty.Cmp.AttentionRegion.t()
Asks the module a question about its state, and answers only the answer.
projection runs inside the process that owns the state, so a caller that
wants four numbers out of a module holding ten object models asks for those
four numbers instead of copying the models across to read them. Copying is
not free: the graph memory of a pretrained ten-object module is tens of
megabytes, and a page that refreshes every step was paying for it per step.
The projection must not change the state — this is a read, and the module is left exactly as it was.
@spec reset_stm(server()) :: :ok
Sends what this module believes, for the vote round to combine.
Tells the module whether this episode trains or evaluates.
Names this episode's object without emptying the module's history.
Records which object the module's sensor is on this step.
Names the object this episode is about, as the experiment knows it.
Times the module out without asking it to reconsider.
@spec start_link(spec()) :: GenServer.on_start()
The module's own state, for tests and the run inspector.
Monty's _pass_target_info_to_model: the conclusion an experiment states.
A pretraining experiment does not match; it knows what it showed the agent.
location_on_model is where the object stood the first time this experiment
showed it, so a graph stays where it was learned.
@spec update_ltm_from_stm(server()) :: :ok
Folds the episode into long-term memory, if it was a training episode.
@spec update_stats_after_vote(server()) :: :ok
Settles what the vote round left this module believing.
Monty's update_stats_after_vote, asked of every module after a round — the
module that heard nothing is exactly the one that can have nothing possible.
Checks the module's terminal condition and replies with what it concluded.