kaira.metrics.signal.BitErrorRate

Inheritance diagram for BitErrorRate
- class kaira.metrics.signal.BitErrorRate(threshold: float = 0.5, name: str | None = None, *args: Any, **kwargs: Any)[source]
Bases:
BaseMetricBit Error Rate (BER) metric.
BER measures the number of bit errors divided by the total number of bits transmitted. Lower values indicate better performance. BER is one of the most common figure of merit used to assess systems that transmit digital data from one location to another [Proakis and Salehi, 2007] and serves as the cornerstone for performance evaluation in communications [Barry et al., 2003].
- total_bits
Accumulated total number of bits processed.
- Type:
Tensor
- error_bits
Accumulated number of bit errors.
- Type:
Tensor
Methods
Initialize the BER metric.
Compute the accumulated BER.
Compute metric with mean and standard deviation.
Compute the Bit Error Rate for the current batch.
Reset accumulated statistics.
Update accumulated statistics with results from a new batch.
Attributes
- is_differentiable = False
- higher_is_better = False
- __init__(threshold: float = 0.5, name: str | None = None, *args: Any, **kwargs: Any)[source]
Initialize the BER metric.
- forward(x: Tensor, y: Tensor, *args: Any, **kwargs: Any) Tensor[source]
Compute the Bit Error Rate for the current batch.
- Parameters:
x (Tensor) – The transmitted/original tensor.
y (Tensor) – The received/predicted tensor.
*args – Variable length argument list (unused).
**kwargs – Arbitrary keyword arguments (unused).
- Returns:
Bit error rate for the batch.
- Return type:
Tensor
- update(x: Tensor, y: Tensor, *args: Any, **kwargs: Any) None[source]
Update accumulated statistics with results from a new batch.
- Parameters:
x (Tensor) – The transmitted/original tensor for the current batch.
y (Tensor) – The received/predicted tensor for the current batch.
*args – Variable length argument list (unused).
**kwargs – Arbitrary keyword arguments (unused).
- compute_with_stats(x: Tensor, y: Tensor, *args: Any, **kwargs: Any) Tuple[Tensor, Tensor]
Compute metric with mean and standard deviation.
- Parameters:
x (torch.Tensor) – The first input tensor (typically predictions)
y (torch.Tensor) – The second input tensor (typically targets)
*args – Variable length argument list.
**kwargs – Arbitrary keyword arguments.
- Returns:
Mean and standard deviation of the metric
- Return type:
Tuple[torch.Tensor, torch.Tensor]