diff --git a/dev/index.html b/dev/index.html index e5a279e8..3d9d9b92 100644 --- a/dev/index.html +++ b/dev/index.html @@ -1,30 +1,30 @@ LogExpFunctions · LogExpFunctions.jl

LogExpFunctions

Various special functions based on log and exp moved from StatsFuns.jl into a separate package, to minimize dependencies. These functions only use native Julia code, so there is no need to depend on librmath or similar libraries. See the discussion at StatsFuns.jl#46.

The original authors of these functions are the StatsFuns.jl contributors.

LogExpFunctions supports InverseFunctions.inverse and ChangesOfVariables.test_with_logabsdet_jacobian for log1mexp, log1pexp, log2mexp, logexpm1, logistic, logit, and logcosh (no inverse).

LogExpFunctions.xlogxFunction
xlogx(x)
 

Return x * log(x) for x ≥ 0, handling $x = 0$ by taking the downward limit.

julia> xlogx(0)
-0.0
source
LogExpFunctions.xlog1pyFunction
xlog1py(x, y)
 

Return x * log(1 + y) for y ≥ -1 with correct limit at $x = 0$.

julia> xlog1py(0, -1)
-0.0
source
LogExpFunctions.logisticFunction
logistic(x)
-

The logistic sigmoid function mapping a real number to a value in the interval $[0,1]$,

\[\sigma(x) = \frac{1}{e^{-x} + 1} = \frac{e^x}{1+e^x}.\]

Its inverse is the logit function.

source
LogExpFunctions.logitFunction
logit(x)
-

The logit or log-odds transformation, defined as

\[\operatorname{logit}(x) = \log\left(\frac{x}{1-x}\right)\]

for $0 < x < 1$.

Its inverse is the logistic function.

source
LogExpFunctions.logcoshFunction
logcosh(x)
-

Return log(cosh(x)), carefully evaluated without intermediate calculation of cosh(x).

The implementation ensures logcosh(-x) = logcosh(x).

source
LogExpFunctions.logabssinhFunction
logabssinh(x)
-

Return log(abs(sinh(x))), carefully evaluated without intermediate calculation of sinh(x).

The implementation ensures logabssinh(-x) = logabssinh(x).

source
LogExpFunctions.log1pmxFunction
log1pmx(x)
-

Return log(1 + x) - x.

Use naive calculation or range reduction outside kernel range. Accurate ~2ulps for all x. This will fall back to the naive calculation for argument types different from Float64.

source
LogExpFunctions.logmxp1Function
logmxp1(x)
-

Return log(x) - x + 1 carefully evaluated. This will fall back to the naive calculation for argument types different from Float64.

source
LogExpFunctions.logaddexpFunction
logaddexp(x, y)
-

Return log(exp(x) + exp(y)), avoiding intermediate overflow/undeflow, and handling non-finite values.

source
LogExpFunctions.logsumexpFunction
logsumexp(X)
-

Compute log(sum(exp, X)).

X should be an iterator of real or complex numbers. The result is computed in a numerically stable way that avoids intermediate over- and underflow, using a single pass over the data.

See also logsumexp!.

References

Sebastian Nowozin: Streaming Log-sum-exp Computation

source
logsumexp(X; dims)
-

Compute log.(sum(exp.(X); dims=dims)).

The result is computed in a numerically stable way that avoids intermediate over- and underflow, using a single pass over the data.

See also logsumexp!.

References

Sebastian Nowozin: Streaming Log-sum-exp Computation

source
+0.0source
LogExpFunctions.xexpyFunction
xexpy(x, y)
+

Return x * exp(y) for y > -Inf, or zero if y == -Inf or if x == 0 and y is finite.

julia> xexpy(1.0, -Inf)
+0.0
source
LogExpFunctions.logisticFunction
logistic(x)
+

The logistic sigmoid function mapping a real number to a value in the interval $[0,1]$,

\[\sigma(x) = \frac{1}{e^{-x} + 1} = \frac{e^x}{1+e^x}.\]

Its inverse is the logit function.

source
LogExpFunctions.logitFunction
logit(x)
+

The logit or log-odds transformation, defined as

\[\operatorname{logit}(x) = \log\left(\frac{x}{1-x}\right)\]

for $0 < x < 1$.

Its inverse is the logistic function.

source
LogExpFunctions.logcoshFunction
logcosh(x)
+

Return log(cosh(x)), carefully evaluated without intermediate calculation of cosh(x).

The implementation ensures logcosh(-x) = logcosh(x).

source
LogExpFunctions.logabssinhFunction
logabssinh(x)
+

Return log(abs(sinh(x))), carefully evaluated without intermediate calculation of sinh(x).

The implementation ensures logabssinh(-x) = logabssinh(x).

source
LogExpFunctions.log1psqFunction
log1psq(x)
+

Return log(1+x^2) evaluated carefully for abs(x) very small or very large.

source
LogExpFunctions.log1pexpFunction
log1pexp(x)
+

Return log(1+exp(x)) evaluated carefully for largish x.

This is also called the "softplus" transformation, being a smooth approximation to max(0,x). Its inverse is logexpm1.

See:

source
LogExpFunctions.log1mexpFunction
log1mexp(x)
+

Return log(1 - exp(x))

See:

Note: different than Maechler (2012), no negation inside parentheses

source
LogExpFunctions.log2mexpFunction
log2mexp(x)
+

Return log(2 - exp(x)) evaluated as log1p(-expm1(x))

source
LogExpFunctions.logexpm1Function
logexpm1(x)
+

Return log(exp(x) - 1) or the “invsoftplus” function. It is the inverse of log1pexp (aka “softplus”).

source
LogExpFunctions.log1pmxFunction
log1pmx(x)
+

Return log(1 + x) - x.

Use naive calculation or range reduction outside kernel range. Accurate ~2ulps for all x. This will fall back to the naive calculation for argument types different from Float64.

source
LogExpFunctions.logmxp1Function
logmxp1(x)
+

Return log(x) - x + 1 carefully evaluated. This will fall back to the naive calculation for argument types different from Float64.

source
LogExpFunctions.logaddexpFunction
logaddexp(x, y)
+

Return log(exp(x) + exp(y)), avoiding intermediate overflow/undeflow, and handling non-finite values.

source
LogExpFunctions.logsubexpFunction
logsubexp(x, y)
+

Return log(abs(exp(x) - exp(y))), preserving numerical accuracy.

source
LogExpFunctions.logsumexpFunction
logsumexp(X)
+

Compute log(sum(exp, X)).

X should be an iterator of real or complex numbers. The result is computed in a numerically stable way that avoids intermediate over- and underflow, using a single pass over the data.

See also logsumexp!.

References

Sebastian Nowozin: Streaming Log-sum-exp Computation

source
logsumexp(X; dims)
+

Compute log.(sum(exp.(X); dims=dims)).

The result is computed in a numerically stable way that avoids intermediate over- and underflow, using a single pass over the data.

See also logsumexp!.

References

Sebastian Nowozin: Streaming Log-sum-exp Computation

source
LogExpFunctions.logsumexp!Function
logsumexp!(out, X)
+

Compute logsumexp of X over the singleton dimensions of out, and write results to out.

The result is computed in a numerically stable way that avoids intermediate over- and underflow, using a single pass over the data.

See also logsumexp.

References

Sebastian Nowozin: Streaming Log-sum-exp Computation

source
LogExpFunctions.softmax!Function
softmax!(r::AbstractArray{<:Real}, x::AbstractArray{<:Real}=r; dims=:)

Overwrite r with the softmax transformation of x over dimension dims.

That is, r is overwritten with exp.(x), normalized to sum to 1 over the given dimensions.

See also: softmax

source
LogExpFunctions.softmaxFunction
softmax(x::AbstractArray{<:Real}; dims=:)

Return the softmax transformation of x over dimension dims.

That is, return exp.(x), normalized to sum to 1 over the given dimensions.

See also: softmax!

source
LogExpFunctions.cloglogFunction
cloglog(x)
+

Compute the complementary log-log, log(-log(1 - x)).

source
LogExpFunctions.cexpexpFunction
cexpexp(x)
+

Compute the complementary double exponential, 1 - exp(-exp(x)).

source
diff --git a/dev/search/index.html b/dev/search/index.html index cd320a7b..73586e1c 100644 --- a/dev/search/index.html +++ b/dev/search/index.html @@ -1,2 +1,2 @@ -Search · LogExpFunctions.jl

Loading search...

    +Search · LogExpFunctions.jl

    Loading search...

      diff --git a/dev/search_index.js b/dev/search_index.js index fb086523..632acdc4 100644 --- a/dev/search_index.js +++ b/dev/search_index.js @@ -1,3 +1,3 @@ var documenterSearchIndex = {"docs": -[{"location":"#LogExpFunctions","page":"LogExpFunctions","title":"LogExpFunctions","text":"","category":"section"},{"location":"","page":"LogExpFunctions","title":"LogExpFunctions","text":"Various special functions based on log and exp moved from StatsFuns.jl into a separate package, to minimize dependencies. These functions only use native Julia code, so there is no need to depend on librmath or similar libraries. See the discussion at StatsFuns.jl#46.","category":"page"},{"location":"","page":"LogExpFunctions","title":"LogExpFunctions","text":"The original authors of these functions are the StatsFuns.jl contributors.","category":"page"},{"location":"","page":"LogExpFunctions","title":"LogExpFunctions","text":"LogExpFunctions supports InverseFunctions.inverse and ChangesOfVariables.test_with_logabsdet_jacobian for log1mexp, log1pexp, log2mexp, logexpm1, logistic, logit, and logcosh (no inverse).","category":"page"},{"location":"","page":"LogExpFunctions","title":"LogExpFunctions","text":"xlogx\nxlogy\nxlog1py\nxexpx\nxexpy\nlogistic\nlogit\nlogcosh\nlogabssinh\nlog1psq\nlog1pexp\nlog1mexp\nlog2mexp\nlogexpm1\nlog1pmx\nlogmxp1\nlogaddexp\nlogsubexp\nlogsumexp\nlogsumexp!\nsoftmax!\nsoftmax\ncloglog\ncexpexp","category":"page"},{"location":"#LogExpFunctions.xlogx","page":"LogExpFunctions","title":"LogExpFunctions.xlogx","text":"xlogx(x)\n\n\nReturn x * log(x) for x ≥ 0, handling x = 0 by taking the downward limit.\n\njulia> xlogx(0)\n0.0\n\n\n\n\n\n","category":"function"},{"location":"#LogExpFunctions.xlogy","page":"LogExpFunctions","title":"LogExpFunctions.xlogy","text":"xlogy(x, y)\n\n\nReturn x * log(y) for y > 0 with correct limit at x = 0.\n\njulia> xlogy(0, 0)\n0.0\n\n\n\n\n\n","category":"function"},{"location":"#LogExpFunctions.xlog1py","page":"LogExpFunctions","title":"LogExpFunctions.xlog1py","text":"xlog1py(x, y)\n\n\nReturn x * log(1 + y) for y ≥ -1 with correct limit at x = 0.\n\njulia> xlog1py(0, -1)\n0.0\n\n\n\n\n\n","category":"function"},{"location":"#LogExpFunctions.xexpx","page":"LogExpFunctions","title":"LogExpFunctions.xexpx","text":"xexpx(x)\n\n\nReturn x * exp(x) for x > -Inf, or zero if x == -Inf.\n\njulia> xexpx(-Inf)\n0.0\n\n\n\n\n\n","category":"function"},{"location":"#LogExpFunctions.xexpy","page":"LogExpFunctions","title":"LogExpFunctions.xexpy","text":"xexpy(x, y)\n\n\nReturn x * exp(y) for y > -Inf, or zero if y == -Inf.\n\njulia> xexpy(1.0, -Inf)\n0.0\n\n\n\n\n\n","category":"function"},{"location":"#LogExpFunctions.logistic","page":"LogExpFunctions","title":"LogExpFunctions.logistic","text":"logistic(x)\n\n\nThe logistic sigmoid function mapping a real number to a value in the interval 01,\n\nsigma(x) = frac1e^-x + 1 = frace^x1+e^x\n\nIts inverse is the logit function.\n\n\n\n\n\n","category":"function"},{"location":"#LogExpFunctions.logit","page":"LogExpFunctions","title":"LogExpFunctions.logit","text":"logit(x)\n\n\nThe logit or log-odds transformation, defined as\n\noperatornamelogit(x) = logleft(fracx1-xright)\n\nfor 0 x 1.\n\nIts inverse is the logistic function.\n\n\n\n\n\n","category":"function"},{"location":"#LogExpFunctions.logcosh","page":"LogExpFunctions","title":"LogExpFunctions.logcosh","text":"logcosh(x)\n\n\nReturn log(cosh(x)), carefully evaluated without intermediate calculation of cosh(x).\n\nThe implementation ensures logcosh(-x) = logcosh(x).\n\n\n\n\n\n","category":"function"},{"location":"#LogExpFunctions.logabssinh","page":"LogExpFunctions","title":"LogExpFunctions.logabssinh","text":"logabssinh(x)\n\n\nReturn log(abs(sinh(x))), carefully evaluated without intermediate calculation of sinh(x).\n\nThe implementation ensures logabssinh(-x) = logabssinh(x).\n\n\n\n\n\n","category":"function"},{"location":"#LogExpFunctions.log1psq","page":"LogExpFunctions","title":"LogExpFunctions.log1psq","text":"log1psq(x)\n\n\nReturn log(1+x^2) evaluated carefully for abs(x) very small or very large.\n\n\n\n\n\n","category":"function"},{"location":"#LogExpFunctions.log1pexp","page":"LogExpFunctions","title":"LogExpFunctions.log1pexp","text":"log1pexp(x)\n\n\nReturn log(1+exp(x)) evaluated carefully for largish x.\n\nThis is also called the \"softplus\" transformation, being a smooth approximation to max(0,x). Its inverse is logexpm1.\n\nSee:\n\nMartin Maechler (2012) “Accurately Computing log(1 − exp(− |a|))”\n\n\n\n\n\n","category":"function"},{"location":"#LogExpFunctions.log1mexp","page":"LogExpFunctions","title":"LogExpFunctions.log1mexp","text":"log1mexp(x)\n\n\nReturn log(1 - exp(x))\n\nSee:\n\nMartin Maechler (2012) “Accurately Computing log(1 − exp(− |a|))”\n\nNote: different than Maechler (2012), no negation inside parentheses\n\n\n\n\n\n","category":"function"},{"location":"#LogExpFunctions.log2mexp","page":"LogExpFunctions","title":"LogExpFunctions.log2mexp","text":"log2mexp(x)\n\n\nReturn log(2 - exp(x)) evaluated as log1p(-expm1(x))\n\n\n\n\n\n","category":"function"},{"location":"#LogExpFunctions.logexpm1","page":"LogExpFunctions","title":"LogExpFunctions.logexpm1","text":"logexpm1(x)\n\n\nReturn log(exp(x) - 1) or the “invsoftplus” function. It is the inverse of log1pexp (aka “softplus”).\n\n\n\n\n\n","category":"function"},{"location":"#LogExpFunctions.log1pmx","page":"LogExpFunctions","title":"LogExpFunctions.log1pmx","text":"log1pmx(x)\n\n\nReturn log(1 + x) - x.\n\nUse naive calculation or range reduction outside kernel range. Accurate ~2ulps for all x. This will fall back to the naive calculation for argument types different from Float64.\n\n\n\n\n\n","category":"function"},{"location":"#LogExpFunctions.logmxp1","page":"LogExpFunctions","title":"LogExpFunctions.logmxp1","text":"logmxp1(x)\n\n\nReturn log(x) - x + 1 carefully evaluated. This will fall back to the naive calculation for argument types different from Float64.\n\n\n\n\n\n","category":"function"},{"location":"#LogExpFunctions.logaddexp","page":"LogExpFunctions","title":"LogExpFunctions.logaddexp","text":"logaddexp(x, y)\n\n\nReturn log(exp(x) + exp(y)), avoiding intermediate overflow/undeflow, and handling non-finite values.\n\n\n\n\n\n","category":"function"},{"location":"#LogExpFunctions.logsubexp","page":"LogExpFunctions","title":"LogExpFunctions.logsubexp","text":"logsubexp(x, y)\n\n\nReturn log(abs(exp(x) - exp(y))), preserving numerical accuracy.\n\n\n\n\n\n","category":"function"},{"location":"#LogExpFunctions.logsumexp","page":"LogExpFunctions","title":"LogExpFunctions.logsumexp","text":"logsumexp(X)\n\n\nCompute log(sum(exp, X)).\n\nX should be an iterator of real or complex numbers. The result is computed in a numerically stable way that avoids intermediate over- and underflow, using a single pass over the data.\n\nSee also logsumexp!.\n\nReferences\n\nSebastian Nowozin: Streaming Log-sum-exp Computation\n\n\n\n\n\nlogsumexp(X; dims)\n\n\nCompute log.(sum(exp.(X); dims=dims)).\n\nThe result is computed in a numerically stable way that avoids intermediate over- and underflow, using a single pass over the data.\n\nSee also logsumexp!.\n\nReferences\n\nSebastian Nowozin: Streaming Log-sum-exp Computation\n\n\n\n\n\n","category":"function"},{"location":"#LogExpFunctions.logsumexp!","page":"LogExpFunctions","title":"LogExpFunctions.logsumexp!","text":"logsumexp!(out, X)\n\n\nCompute logsumexp of X over the singleton dimensions of out, and write results to out.\n\nThe result is computed in a numerically stable way that avoids intermediate over- and underflow, using a single pass over the data.\n\nSee also logsumexp.\n\nReferences\n\nSebastian Nowozin: Streaming Log-sum-exp Computation\n\n\n\n\n\n","category":"function"},{"location":"#LogExpFunctions.softmax!","page":"LogExpFunctions","title":"LogExpFunctions.softmax!","text":"softmax!(r::AbstractArray{<:Real}, x::AbstractArray{<:Real}=r; dims=:)\n\nOverwrite r with the softmax transformation of x over dimension dims.\n\nThat is, r is overwritten with exp.(x), normalized to sum to 1 over the given dimensions.\n\nSee also: softmax\n\n\n\n\n\n","category":"function"},{"location":"#LogExpFunctions.softmax","page":"LogExpFunctions","title":"LogExpFunctions.softmax","text":"softmax(x::AbstractArray{<:Real}; dims=:)\n\nReturn the softmax transformation of x over dimension dims.\n\nThat is, return exp.(x), normalized to sum to 1 over the given dimensions.\n\nSee also: softmax!\n\n\n\n\n\n","category":"function"},{"location":"#LogExpFunctions.cloglog","page":"LogExpFunctions","title":"LogExpFunctions.cloglog","text":"cloglog(x)\n\n\nCompute the complementary log-log, log(-log(1 - x)).\n\n\n\n\n\n","category":"function"},{"location":"#LogExpFunctions.cexpexp","page":"LogExpFunctions","title":"LogExpFunctions.cexpexp","text":"cexpexp(x)\n\n\nCompute the complementary double exponential, 1 - exp(-exp(x)).\n\n\n\n\n\n","category":"function"}] +[{"location":"#LogExpFunctions","page":"LogExpFunctions","title":"LogExpFunctions","text":"","category":"section"},{"location":"","page":"LogExpFunctions","title":"LogExpFunctions","text":"Various special functions based on log and exp moved from StatsFuns.jl into a separate package, to minimize dependencies. These functions only use native Julia code, so there is no need to depend on librmath or similar libraries. See the discussion at StatsFuns.jl#46.","category":"page"},{"location":"","page":"LogExpFunctions","title":"LogExpFunctions","text":"The original authors of these functions are the StatsFuns.jl contributors.","category":"page"},{"location":"","page":"LogExpFunctions","title":"LogExpFunctions","text":"LogExpFunctions supports InverseFunctions.inverse and ChangesOfVariables.test_with_logabsdet_jacobian for log1mexp, log1pexp, log2mexp, logexpm1, logistic, logit, and logcosh (no inverse).","category":"page"},{"location":"","page":"LogExpFunctions","title":"LogExpFunctions","text":"xlogx\nxlogy\nxlog1py\nxexpx\nxexpy\nlogistic\nlogit\nlogcosh\nlogabssinh\nlog1psq\nlog1pexp\nlog1mexp\nlog2mexp\nlogexpm1\nlog1pmx\nlogmxp1\nlogaddexp\nlogsubexp\nlogsumexp\nlogsumexp!\nsoftmax!\nsoftmax\ncloglog\ncexpexp","category":"page"},{"location":"#LogExpFunctions.xlogx","page":"LogExpFunctions","title":"LogExpFunctions.xlogx","text":"xlogx(x)\n\n\nReturn x * log(x) for x ≥ 0, handling x = 0 by taking the downward limit.\n\njulia> xlogx(0)\n0.0\n\n\n\n\n\n","category":"function"},{"location":"#LogExpFunctions.xlogy","page":"LogExpFunctions","title":"LogExpFunctions.xlogy","text":"xlogy(x, y)\n\n\nReturn x * log(y) for y > 0 with correct limit at x = 0.\n\njulia> xlogy(0, 0)\n0.0\n\n\n\n\n\n","category":"function"},{"location":"#LogExpFunctions.xlog1py","page":"LogExpFunctions","title":"LogExpFunctions.xlog1py","text":"xlog1py(x, y)\n\n\nReturn x * log(1 + y) for y ≥ -1 with correct limit at x = 0.\n\njulia> xlog1py(0, -1)\n0.0\n\n\n\n\n\n","category":"function"},{"location":"#LogExpFunctions.xexpx","page":"LogExpFunctions","title":"LogExpFunctions.xexpx","text":"xexpx(x)\n\n\nReturn x * exp(x) for x > -Inf, or zero if x == -Inf.\n\njulia> xexpx(-Inf)\n0.0\n\n\n\n\n\n","category":"function"},{"location":"#LogExpFunctions.xexpy","page":"LogExpFunctions","title":"LogExpFunctions.xexpy","text":"xexpy(x, y)\n\n\nReturn x * exp(y) for y > -Inf, or zero if y == -Inf or if x == 0 and y is finite.\n\njulia> xexpy(1.0, -Inf)\n0.0\n\n\n\n\n\n","category":"function"},{"location":"#LogExpFunctions.logistic","page":"LogExpFunctions","title":"LogExpFunctions.logistic","text":"logistic(x)\n\n\nThe logistic sigmoid function mapping a real number to a value in the interval 01,\n\nsigma(x) = frac1e^-x + 1 = frace^x1+e^x\n\nIts inverse is the logit function.\n\n\n\n\n\n","category":"function"},{"location":"#LogExpFunctions.logit","page":"LogExpFunctions","title":"LogExpFunctions.logit","text":"logit(x)\n\n\nThe logit or log-odds transformation, defined as\n\noperatornamelogit(x) = logleft(fracx1-xright)\n\nfor 0 x 1.\n\nIts inverse is the logistic function.\n\n\n\n\n\n","category":"function"},{"location":"#LogExpFunctions.logcosh","page":"LogExpFunctions","title":"LogExpFunctions.logcosh","text":"logcosh(x)\n\n\nReturn log(cosh(x)), carefully evaluated without intermediate calculation of cosh(x).\n\nThe implementation ensures logcosh(-x) = logcosh(x).\n\n\n\n\n\n","category":"function"},{"location":"#LogExpFunctions.logabssinh","page":"LogExpFunctions","title":"LogExpFunctions.logabssinh","text":"logabssinh(x)\n\n\nReturn log(abs(sinh(x))), carefully evaluated without intermediate calculation of sinh(x).\n\nThe implementation ensures logabssinh(-x) = logabssinh(x).\n\n\n\n\n\n","category":"function"},{"location":"#LogExpFunctions.log1psq","page":"LogExpFunctions","title":"LogExpFunctions.log1psq","text":"log1psq(x)\n\n\nReturn log(1+x^2) evaluated carefully for abs(x) very small or very large.\n\n\n\n\n\n","category":"function"},{"location":"#LogExpFunctions.log1pexp","page":"LogExpFunctions","title":"LogExpFunctions.log1pexp","text":"log1pexp(x)\n\n\nReturn log(1+exp(x)) evaluated carefully for largish x.\n\nThis is also called the \"softplus\" transformation, being a smooth approximation to max(0,x). Its inverse is logexpm1.\n\nSee:\n\nMartin Maechler (2012) “Accurately Computing log(1 − exp(− |a|))”\n\n\n\n\n\n","category":"function"},{"location":"#LogExpFunctions.log1mexp","page":"LogExpFunctions","title":"LogExpFunctions.log1mexp","text":"log1mexp(x)\n\n\nReturn log(1 - exp(x))\n\nSee:\n\nMartin Maechler (2012) “Accurately Computing log(1 − exp(− |a|))”\n\nNote: different than Maechler (2012), no negation inside parentheses\n\n\n\n\n\n","category":"function"},{"location":"#LogExpFunctions.log2mexp","page":"LogExpFunctions","title":"LogExpFunctions.log2mexp","text":"log2mexp(x)\n\n\nReturn log(2 - exp(x)) evaluated as log1p(-expm1(x))\n\n\n\n\n\n","category":"function"},{"location":"#LogExpFunctions.logexpm1","page":"LogExpFunctions","title":"LogExpFunctions.logexpm1","text":"logexpm1(x)\n\n\nReturn log(exp(x) - 1) or the “invsoftplus” function. It is the inverse of log1pexp (aka “softplus”).\n\n\n\n\n\n","category":"function"},{"location":"#LogExpFunctions.log1pmx","page":"LogExpFunctions","title":"LogExpFunctions.log1pmx","text":"log1pmx(x)\n\n\nReturn log(1 + x) - x.\n\nUse naive calculation or range reduction outside kernel range. Accurate ~2ulps for all x. This will fall back to the naive calculation for argument types different from Float64.\n\n\n\n\n\n","category":"function"},{"location":"#LogExpFunctions.logmxp1","page":"LogExpFunctions","title":"LogExpFunctions.logmxp1","text":"logmxp1(x)\n\n\nReturn log(x) - x + 1 carefully evaluated. This will fall back to the naive calculation for argument types different from Float64.\n\n\n\n\n\n","category":"function"},{"location":"#LogExpFunctions.logaddexp","page":"LogExpFunctions","title":"LogExpFunctions.logaddexp","text":"logaddexp(x, y)\n\n\nReturn log(exp(x) + exp(y)), avoiding intermediate overflow/undeflow, and handling non-finite values.\n\n\n\n\n\n","category":"function"},{"location":"#LogExpFunctions.logsubexp","page":"LogExpFunctions","title":"LogExpFunctions.logsubexp","text":"logsubexp(x, y)\n\n\nReturn log(abs(exp(x) - exp(y))), preserving numerical accuracy.\n\n\n\n\n\n","category":"function"},{"location":"#LogExpFunctions.logsumexp","page":"LogExpFunctions","title":"LogExpFunctions.logsumexp","text":"logsumexp(X)\n\n\nCompute log(sum(exp, X)).\n\nX should be an iterator of real or complex numbers. The result is computed in a numerically stable way that avoids intermediate over- and underflow, using a single pass over the data.\n\nSee also logsumexp!.\n\nReferences\n\nSebastian Nowozin: Streaming Log-sum-exp Computation\n\n\n\n\n\nlogsumexp(X; dims)\n\n\nCompute log.(sum(exp.(X); dims=dims)).\n\nThe result is computed in a numerically stable way that avoids intermediate over- and underflow, using a single pass over the data.\n\nSee also logsumexp!.\n\nReferences\n\nSebastian Nowozin: Streaming Log-sum-exp Computation\n\n\n\n\n\n","category":"function"},{"location":"#LogExpFunctions.logsumexp!","page":"LogExpFunctions","title":"LogExpFunctions.logsumexp!","text":"logsumexp!(out, X)\n\n\nCompute logsumexp of X over the singleton dimensions of out, and write results to out.\n\nThe result is computed in a numerically stable way that avoids intermediate over- and underflow, using a single pass over the data.\n\nSee also logsumexp.\n\nReferences\n\nSebastian Nowozin: Streaming Log-sum-exp Computation\n\n\n\n\n\n","category":"function"},{"location":"#LogExpFunctions.softmax!","page":"LogExpFunctions","title":"LogExpFunctions.softmax!","text":"softmax!(r::AbstractArray{<:Real}, x::AbstractArray{<:Real}=r; dims=:)\n\nOverwrite r with the softmax transformation of x over dimension dims.\n\nThat is, r is overwritten with exp.(x), normalized to sum to 1 over the given dimensions.\n\nSee also: softmax\n\n\n\n\n\n","category":"function"},{"location":"#LogExpFunctions.softmax","page":"LogExpFunctions","title":"LogExpFunctions.softmax","text":"softmax(x::AbstractArray{<:Real}; dims=:)\n\nReturn the softmax transformation of x over dimension dims.\n\nThat is, return exp.(x), normalized to sum to 1 over the given dimensions.\n\nSee also: softmax!\n\n\n\n\n\n","category":"function"},{"location":"#LogExpFunctions.cloglog","page":"LogExpFunctions","title":"LogExpFunctions.cloglog","text":"cloglog(x)\n\n\nCompute the complementary log-log, log(-log(1 - x)).\n\n\n\n\n\n","category":"function"},{"location":"#LogExpFunctions.cexpexp","page":"LogExpFunctions","title":"LogExpFunctions.cexpexp","text":"cexpexp(x)\n\n\nCompute the complementary double exponential, 1 - exp(-exp(x)).\n\n\n\n\n\n","category":"function"}] }