
Self-supervised learning: generate labels from the data itself via pretext task
Source:R/geron_w4d_native.R
morie_geron_self_supervised.Rd"mask": hold out one feature, predict it from the rest, per feature.
"denoise": corrupt inputs with deterministic LCG noise, reconstruct.
A function may be passed instead: pretext(X) returning list(Xp, yp).
Examples
V <- c(1, 2, 3, 4, 5, 6, 7, 8)
morie_geron_self_supervised(V)
#> $loss
#> [1] 5.25
#>
#> $task_losses
#> [1] 5.25
#>
#> $predictions
#> [,1]
#> [1,] 4.5
#> [2,] 4.5
#> [3,] 4.5
#> [4,] 4.5
#> [5,] 4.5
#> [6,] 4.5
#> [7,] 4.5
#> [8,] 4.5
#>
#> $targets
#> [,1]
#> [1,] 1
#> [2,] 2
#> [3,] 3
#> [4,] 4
#> [5,] 5
#> [6,] 6
#> [7,] 7
#> [8,] 8
#>
#> $r2
#> [1] 0
#>
#> $pretext
#> [1] "mask"
#>
#> $estimate
#> [1] 5.25
#>
#> $n
#> [1] 8
#>
#> $method
#> [1] "Self-supervised 'mask' pretext solved by least squares; no external labels used"
#>