
Max-norm projection (Geron Ch 11, morie.fn hmmnr)
Source:R/geron_ml2_native.R
morie_geron_max_norm.RdA projection, not a penalty: each weight vector keeps its direction
and only its length is capped at r. axis follows numpy on a
matrix: 0 = down columns, 1 (or -1) = across rows; NULL treats the
whole array as one vector.
Examples
morie_geron_max_norm(w = c(1, 2, 3, 4, 5, 6, 7, 8), r = 5L)
#> $w
#> [1] 0.35007 0.70014 1.05021 1.40028 1.75035 2.10042 2.45049 2.80056
#>
#> $norm_before
#> [1] 14.28286
#>
#> $norm_after
#> [1] 5
#>
#> $clipped
#> [1] TRUE
#>
#> $n_clipped
#> [1] 1
#>
#> $r
#> [1] 5
#>
#> $estimate
#> [1] 5
#>
#> $n
#> [1] 8
#>
#> $method
#> [1] "Max-norm regularization (projection onto the l2 ball)"
#>