Skip to main content

Module sc_inference

Module sc_inference 

Source
Expand description

Stochastic forward pass over caller-owned packed weight bitstreams.

The input encoder is the 16-bit LFSR comparator (encoder::Lfsr16 semantics: taps 16, 14, 13, 11; bit = reg < x_value then advance), so the result is bit-identical to the NumPy fallback in src/sc_neurocore/accel/sc_inference.py for a fixed seed.

Enumsยง

ScForwardError
SC inference contract errors.

Functionsยง

input_seed ๐Ÿ”’
Per-input non-zero 16-bit LFSR seed derived from the base seed.
lfsr_encode_packed ๐Ÿ”’
Encode one probability into a length-bit LFSR comparator stream, packed LSB-first into the out words (matching bitstream::pack).
sc_forward_packed
Stochastic forward pass over pre-packed unipolar weight bitstreams.