
Max-norm weight projection (Geron Ch 11, morie.fn grmnr)
Source:R/geron_train_native.R
morie_geron_max_norm_regularization.RdPer-row (axis = 1) or per-column (axis = 0) w *= min(1, r/||w||); a
constraint applied after the step, not a penalty. rows_projected
is 0-based.
Examples
morie_geron_max_norm_regularization(W = c(1, 2, 3, 4, 5, 6, 7, 8), r = 5L)
#> $W_new
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8]
#> [1,] 0.35007 0.70014 1.05021 1.40028 1.75035 2.10042 2.45049 2.80056
#>
#> $norms_before
#> [1] 14.28286
#>
#> $norms_after
#> [1] 5
#>
#> $n_projected
#> [1] 1
#>
#> $rows_projected
#> [1] 0
#>
#> $r
#> [1] 5
#>
#> $estimate
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8]
#> [1,] 0.35007 0.70014 1.05021 1.40028 1.75035 2.10042 2.45049 2.80056
#>
#> $n
#> [1] 1
#>