ScalarPNorm

Source: models/common/ScalarPNorm.py

Weighted \(p\)-norm of an arbitrary number of Scalar inputs: \(y = (\sum_i w_i |x_i|^p + \varepsilon)^{1/p}\). The weights default to 1 (giving the standard \(p\)-norm) and can be set per-input via the weights option, mirroring LinearCombination. The dtype-aware regularizer \(\varepsilon\) comes from neml2::machine_precision().

Inputs

frominput · Scalar · required

Scalar variables to be combined

Outputs

tooutput · Scalar · required

The weighted p-norm output

Parameters

exponentparameter · Scalar · required

The exponent

weightsparameter · Scalar · default 1

Per-input weights. List length must be 1 or from-length; a single value is broadcast to all inputs.