softplus: Stable computation of the softplus function

View source: R/utils.R

softplusR Documentation

Stable computation of the softplus function

Description

Computes the softplus function \log(1+e^{t}) in a numerically stable way for large absolute values of t.

Usage

softplus(t)

Arguments

t

vector or matrix.

Value

The softplus function evaluated at t.

Examples

curve(softplus(10 * (1 - (1 - x) / 0.1)), from = -1, to = 1)

polykde documentation built on June 8, 2025, 1:49 p.m.