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 April 16, 2025, 1:11 a.m.