DecoderStatisticsCallback#
- class sionna.phy.fec.ldpc.DecoderStatisticsCallback(num_iter: int, device: str | None = None)[source]#
Bases:
sionna.phy.object.ObjectCallback for the LDPCBPDecoder to track decoder statistics.
Can be registered as
c2v_callbacksin theLDPCBPDecoderand theLDPC5GDecoder.Remark: the decoding statistics are based on CN convergence, i.e., successful decoding is assumed if all check nodes are fulfilled. This overestimates the success-rate as it includes cases where the decoder converges to the wrong codeword.
- Parameters:
- Inputs:
msg – [batch_size, num_vns, max_degree], torch.float. v2c messages.
it – int. Current number of decoding iterations.
- Outputs:
msg – torch.float. Same as
msg.
Examples
from sionna.phy.fec.ldpc import LDPCBPDecoder from sionna.phy.fec.ldpc.utils import DecoderStatisticsCallback # Create callback stats_cb = DecoderStatisticsCallback(num_iter=20) # Create decoder with callback decoder = LDPCBPDecoder(pcm, c2v_callbacks=[stats_cb]) # After decoding, access statistics print(stats_cb.success_rate) print(stats_cb.avg_number_iterations)
Attributes
- property num_samples: torch.Tensor#
Total number of processed codewords
- property num_decoded_cws: torch.Tensor#
Number of decoded codewords after each iteration
- property success_rate: torch.Tensor#
Success rate after each iteration
- property avg_number_iterations: torch.Tensor#
Average number of decoding iterations
Methods