Mini-batch stochastic gradient descent for OLS (R parity)
Source:R/mbgrd.R
morie_mini_batch_gradient.RdMini-batch stochastic gradient descent for OLS (R parity)
Examples
morie_mini_batch_gradient(x = rnorm(50), y = rnorm(50))
#> $estimate
#> [1] 0.11399434 -0.06680088
#>
#> $reference_ols
#> [1] 0.11477864 -0.06321482
#>
#> $n_epochs
#> [1] 200
#>
#> $batch_size
#> [1] 32
#>
#> $loss
#> [1] 0.7347753
#>
#> $n
#> [1] 50
#>
#> $method
#> [1] "Mini-batch SGD (linear regression)"
#>