OSTTP#

class braintrace.OSTTP(model, B_list, target_timing='per-step', name=None, vjp_method='single-step', fast_solve=True, **kwargs)#

Online Spatio-Temporal Target Projection.

Parameters:
  • model (Module)

  • B_list (Sequence[Array]) – One feedback matrix per HiddenGroup, each of shape (n_target, n_l). Frozen via stop_gradient at construction.

  • target_timing (str) – ‘per-step’ requires y_target at every update() call. ‘sequence-end’ zeros the signal on intermediate steps and only applies the projection when y_target is supplied.

  • name (str | None)

  • vjp_method (str)

  • fast_solve (bool)

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:

None

update(x, y_target=None)[source]#

Call super().update(x) after stashing y_target for the hook.