Min-Max Aggregator

class bacon.aggregators.bool.min_max.MinMaxAggregator(*args, **kwargs)

Aggregate a sequence of inputs with min/max interpolation.

The aggregator computes:

  • elementwise minimum when andness is near 1

  • elementwise maximum when andness is near 0

with a straight-through hard gating step so gradients can still flow through the continuous proxy during training.

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

Float-friendly wrapper around aggregate_tensor().

Parameters:
  • values – Input scalar values to aggregate.

  • a – Andness control value.

  • weights – Optional per-input weights used as soft gates.

Returns:

Python float result.

aggregate_tensor(values: Sequence[Any], andness, weights=None)

Aggregate one or more tensor-like values.

Parameters:
  • values – Non-empty sequence of tensors with compatible shapes.

  • andness – Control signal where larger values bias toward min/AND and smaller values bias toward max/OR.

  • weights – Optional per-input gates in [0, 1]. When provided, each input is blended with a neutral baseline before reduction.

Returns:

Tensor with the same broadcast-compatible shape as each input.

Raises:

ValueError – If values is empty.