OTPE#
- class braintrace.OTPE(model, mode='full', leak=None, name=None, vjp_method='single-step', trace_clip_abs=None, **kwargs)#
Online Training with Postsynaptic Estimates.
- Parameters:
model (
Module)mode (
str) – ‘full’ keeps the(batch, I, O)R_hatper layer. ‘approx’ factorsR_hatasouter(ḡ_out, ẑ_in)for O(I+O) memory (F-OTPE variant); issues a UserWarning for depth > 1.leak (
float|None) – λ factor. If None, resolved via_resolve_leak.trace_clip_abs (
float|None) – Elementwise clip onR_hateach step. None disables.vjp_method (
str)
- compile_graph(*args)[source]#
Compile the eligibility trace graph of the relationship between etrace weights, states and operators.
The compilation process includes:
building the etrace graph
separating the states
initializing the etrace states
- Parameters:
*args – The input arguments.
- Return type:
- init_etrace_state(*args, **kwargs)[source]#
Initialize the eligibility trace states of the etrace algorithm.
This method is needed after compiling the etrace graph. See .compile_graph() for the details.
- Parameters:
*args – The positional arguments.
**kwargs – The keyword arguments.
- Raises:
NotImplementedError – This method must be implemented by subclasses.