Aggregator Base Interfaces

class bacon.aggregators.base.AggregatorBase
aggregate(values, a, weights)

Dispatch aggregation for either Python floats or torch.Tensors. Expects:

  • values: Sequence[float] or Sequence[Tensor]

  • a: float or Tensor

  • weights: Sequence[float] or Sequence[Tensor] or Tensor

abstractmethod aggregate_float(values: Sequence[float], a: float, weights: Sequence[float]) float

Aggregate N scalar values with scalar andness a and N weights.

abstractmethod aggregate_tensor(values: Sequence[torch.Tensor], a: torch.Tensor, weights: Sequence[torch.Tensor] | torch.Tensor) torch.Tensor

Aggregate N tensors with andness a and N weights.