Compiler, Executor & Diagnostics#
The compiler analyzes a model’s JAX intermediate representation (jaxpr) to
discover the relationships between ETP primitives, weight parameters, and
hidden states. It recognizes ETP primitives by primitive-type identity
(never by string-matching names), and the result is an ETraceGraph
that the executor and the online-learning algorithms consume.
Most users never call this layer directly — compile() and the algorithm
classes drive it for you. It is documented here for building custom algorithms,
inspecting what the compiler discovered, and acting on diagnostics.
Graph Compilation#
The entry point that compiles a model into an eligibility-trace graph, and the graph object it returns.
Construct the eligibility-trace graph for a given model and inputs. |
|
The overall compiled graph for the eligibility trace. |
Module Info#
Extracts the jaxpr and state information from a brainstate.nn.Module.
ModuleInfo is the compiler’s structured view of a model.
Extract the model information for the ETrace compiler. |
|
The model information for the ETrace compiler. |
Graph Executor#
Executes the compiled graph: runs the forward pass and computes the
hidden-to-weight and hidden-to-hidden Jacobians the algorithms consume.
ETraceVjpGraphExecutor is the VJP-based executor used by the
ETraceVjpAlgorithm family.
The eligibility trace graph executor. |
|
The eligibility trace graph executor for the VJP-based online learning algorithms. |
Diagnostics#
Structured, leveled records emitted while the compiler analyzes a model. They
surface issues that would otherwise be silent — for example a trainable input
that does not trace back to a ParamState, or an ETP weight excluded because
it only reaches a hidden state through another trainable primitive.
DiagnosticLevel orders records by severity (INFO < WARNING <
ERROR) and DiagnosticKind names the specific condition.
A single compiler decision, captured with structured context. |
|
Machine-readable reason for a |
|
Severity of a |