Expand description
Predictive coding via XOR + popcount in packed bitstream domain.
Error = XOR(predicted, actual), magnitude = popcount(error) / L. No multiplications needed — maps to XOR gates + popcount tree on FPGA.
Functions§
- batch_
prediction_ error - Batch prediction error: n_neurons × n_inputs packed streams. Returns per-neuron surprise values.
- predict_
and_ xor_ ema - EMA predict-and-XOR loop for spike codec compression. Returns (error_matrix flattened row-major, correct_prediction_count).
- predict_
and_ xor_ lfsr - LFSR predict-and-XOR loop: bit-true with sc_bitstream_encoder.v. Returns (error_matrix flattened row-major, correct_prediction_count).
- prediction_
error_ packed - Compute prediction error between two packed bitstreams via XOR + popcount. Returns error magnitude in [0, 1].
- update_
prediction_ weights - STDP-like weight update: push prediction weight toward actual probability.
- xor_
and_ recover_ ema - EMA XOR-and-recover loop for spike codec decompression.
- xor_
and_ recover_ lfsr - LFSR XOR-and-recover loop for decompression.