Wisp warping function, implemented in R
wisp_warp.RdThis function provides an R implementation of the warping function used to warp model components before input into wisp_sigmoid.
Value
Numeric vector or matrix, warped values. Returned object will have the same dimensions as input z.
Examples
# No warping (w = 0) returns the input unchanged
wisp_warp(c(1, 5, 10), b = 10, w = 0)
#> [1] 1 5 10
# Positive warping factor compresses values toward the bound b
wisp_warp(c(1, 5, 10), b = 10, w = 2)
#> [1] 3.967120 9.323324 10.000000
# Works on a matrix too, preserving its dimensions
wisp_warp(matrix(1:4, 2, 2), b = 10, w = 1)
#> [,1] [,2]
#> [1,] 1.856463 4.814272
#> [2,] 3.450154 5.978080