Smooth maximum
Mathematical approximation
In mathematics, a smooth maximum of an indexed family x1, ..., xn of numbers is a smooth approximation to the maximum function meaning a parametric family of functions
such that for every
, the function
is smooth, and the family converges to the maximum function
as
. The concept of smooth minimum is similarly defined. In many cases, a single family approximates both: maximum as the parameter goes to positive infinity, minimum as the parameter goes to negative infinity; in symbols,
as
and
as
. The term can also be used loosely for a specific smooth function that behaves similarly to a maximum, without necessarily being part of a parametrized family.
01Examples
Boltzmann operator
For large positive values of the parameter , the following formulation is a smooth, differentiable approximation of the maximum function. For negative values of the parameter that are large in absolute value, it approximates the minimum.
has the following properties:
as
is the arithmetic mean of its inputs
as
The gradient of is closely related to softmax and is given by
This makes the softmax function useful for optimization techniques that use gradient descent.
This operator is sometimes called the Boltzmann operator, after the Boltzmann distribution.
LogSumExp
Another smooth maximum is LogSumExp:
This can also be normalized if the are all non-negative, yielding a function with domain
and range
:
The term corrects for the fact that
by canceling out all but one zero exponential, and
if all
are zero.
Mellowmax
The mellowmax operator is defined as follows:
It is a non-expansive operator. As , it acts like a maximum. As
, it acts like an arithmetic mean. As
, it acts like a minimum. This operator can be viewed as a particular instantiation of the quasi-arithmetic mean. It can also be derived from information theoretical principles as a way of regularizing policies with a cost function defined by KL divergence. The operator has previously been utilized in other areas, such as power engineering.
Connection between LogSumExp and Mellowmax
LogSumExp and Mellowmax are the same function differing by a constant . LogSumExp is always larger than the true max, differing at most from the true max by
in the case where all n arguments are equal and being exactly equal to the true max when all but one argument is
. Similarly, Mellowmax is always less than the true max, differing at most from the true max by
in the case where all but one argument is
and being exactly equal to the true max when all n arguments are equal.
p-Norm
Another smooth maximum is the p-norm:
which converges to as
.
An advantage of the p-norm is that it is a norm. As such it is scale invariant (homogeneous): , and it satisfies the triangle inequality.
Smooth maximum unit
The following binary operator is called the Smooth Maximum Unit (SMU):
where is a parameter. As
,
and thus
.

Sources and credits
This article is adapted from the Wikipedia article “Smooth maximum”, written by its contributors and licensed under CC BY-SA 4.0. Fathomly has changed the layout, removed citation markers, navigation and maintenance notices, and adjusted punctuation. This adapted version is shared under the same license. For references, see the original article.
Images, from Wikimedia Commons:
- Smoothmax.png by 1&only, CC BY-SA 4.0
Fathomly is not affiliated with or endorsed by the Wikimedia Foundation. Spotted a problem? Tell us.