StrctTerm.scale_penalty()#
- StrctTerm.scale_penalty()[source]#
Scale the penalty matrix by its infinity norm.
The penalty matrix is divided by its infinity norm (max absolute row sum) so that its values are numerically well-conditioned for downstream use. The updated penalty replaces the previous one.
- Return type:
Self- Returns:
The modified term instance (self).
See also
Basis.scale_penaltyThe term calls this method internally. More details are documented there.
Examples
>>> x = jnp.linspace(0.0, 1.0, 4) >>> basis = Basis( ... jnp.column_stack([jnp.ones_like(x), x]), ... xname="x", ... penalty=2.0 * jnp.eye(2), ... ) >>> term = StrctTerm.f(basis, scale=1.0).scale_penalty() >>> float(jnp.max(term.basis.penalty.value)) 1.0