espnet2.train.reporter.WeightedAverage
Less than 1 minute
espnet2.train.reporter.WeightedAverage
class espnet2.train.reporter.WeightedAverage(value: Tuple[float | int | complex | Tensor | ndarray, float | int | complex | Tensor | ndarray], weight: float | int | complex | Tensor | ndarray)
Bases: ReportedValue
Represents a weighted average of reported values.
value
A tuple containing the value and its associated weight.
- Type: Tuple[Num, Num]
weight
The weight associated with the reported value.
- Type: Num
Examples
>>> weighted_avg = WeightedAverage(value=(3.0, 5.0), weight=0.5)
>>> print(weighted_avg.value)
(3.0, 5.0)
>>> print(weighted_avg.weight)
0.5
value
weight