Neural Network Modules#
braintrace.nn provides neural network layers that use ETP primitives
internally. These layers are drop-in replacements for standard layers
but automatically participate in online learning.
For example, braintrace.nn.Linear uses braintrace.matmul internally,
so its weight is automatically included in eligibility trace computation.
Similarly, braintrace.nn.GRUCell uses braintrace.matmul for its
recurrent weight and braintrace.element_wise for gate operations.
Linear Layers#
Linear transformation layer. |
|
Linear layer with signed absolute weights. |
|
Linear layer with sparse weight matrix. |
|
A standalone LoRA layer. |
Convolutional Layers#
Recurrent Layers#
Vanilla RNN cell. |
|
Gated Recurrent Unit (GRU) cell. |
|
Minimal Gated Recurrent Unit (MGU) cell. |
|
Long short-term memory (LSTM) RNN core. |
|
Update-Reset LSTM (URLSTM) cell. |
|
Minimal RNN Cell. |
|
Minimal GRU cell. |
|
Minimal LSTM cell. |
|
Linear Recurrent Unit (LRU) layer. |
Normalization Layers#
Readout Layers#
Leaky dynamics for the read-out module used in Real-Time Recurrent Learning. |