Skip to content
fn

symexp

→Tensor
symexp(x: Tensor)

Inverse of symlog.

symexp(x)=sign(x)(exp⁡(∣x∣)−1)\mathrm{symexp}(x) = \mathrm{sign}(x)\big(\exp(|x|) - 1\big)

Parameters

Any shape.

Returns

Tensor

Same shape.

Notes

Used to read a prediction back out into the original units — a value head trained against symlog targets predicts in the compressed space, and this is what turns that back into a return.

Uses expm1 rather than exp(·) - 1, which loses precision for small arguments exactly where symlog sends most of its inputs.

Examples

>>> import lucid
>>> import lucid.nn.functional as F
>>> round(float(F.symexp(F.symlog(lucid.tensor([1234.0]))).item()), 2)
1234.0

See Also

  • symlog—The forward transform.

Used by 1