EExponQuay
Product

Product features · Stable log-sum-exp aggregation

01

ExponQuay helps review exponential aggregation around a shifted maximum, keeping empty input distinct from a finite collection of very negative values.

01

Connection

Base URL, credentials and a reachable server.

02

Selection

A model available through the configured endpoint.

03

Capabilities

Context limits and tool support are determined by the model and server.

Stable log-sum-exp aggregation

● ● ●ExponQuay●
A concrete starting point · Stable log-sum-exp aggregation ×
from math import exp, fsum, log, inf

def log_sum_exp(values):
    if type(values) not in (list, tuple) or len(values) > 1000:
        raise ValueError("values.container")
    values = tuple(values)
    if len(values) > 1000 or any(
        type(v) not in (int, float) or not -1e300 <= v <= 1e300 for v in values
    ):
        raise ValueError("values.range")
    if not values:
        return -inf
    peak = max(values)
    return peak + log(fsum(exp(v - peak) for v in values))
✳Aggregate up to 1000 log-values from minus 1e300 through 1e300 by shifting their maximum before exponentiation.
✓ ChangesReview before applying ↗
Illustrative workspace
AI coding workspace

Your next change starts here.

Get the Windows app ↗