Expand description
Neural network layers for BitNet.
This module provides:
BitLinear: Drop-in replacement fornn::Linearwith ternary weights- Straight-Through Estimator for training
Structs§
- BitLinear
- BitLinear layer with ternary weights and INT8 activations.
Functions§
- int8_
ste - Apply INT8 STE (quantize to [-127, 127]).
- ste_
backward - Compute STE backward pass (identity gradient).
- ste_
forward - Apply STE forward pass (quantize then dequantize).
- ternary_
ste - Apply ternary STE (quantize to {-1, 0, +1}).