tanhloss: tanhloss

View source: R/core.R

tanhlossR Documentation

tanhloss

Description

For k > 0, defines Julia code that defines the loss function,

L(\hat{\theta}, \theta) = \tanh\left(\frac{|\hat{\theta} - \theta|}{k}\right),

which approximates the 0-1 loss as k tends to zero.

The resulting string is intended to be used in the function train, but can also be converted to a callable function using juliaEval.

Usage

tanhloss(k)

Arguments

k

Positive numeric value that controls the smoothness of the approximation.

Value

String defining the tanh loss function in Julia code.


NeuralEstimators documentation built on Nov. 3, 2024, 9:07 a.m.