View source: R/optim_functions.R
| SGD | R Documentation |
Performs stochastic gradient descent to optimize the parameters.
SGD(
theta_current,
psi,
X,
delta_Mu,
delta_Nu,
lambda,
alpha = 0.1,
beta = 0.05,
centered = FALSE,
batch_prop = 1/5,
max_iter = 1000,
tol = 0.001,
lr = 0.01,
verbose = FALSE
)
theta_current |
A numeric matrix of size 1 x d (intialization for parameter to estimate). |
psi |
A function that takes an input |
X |
A matrix of covariates of size n x d (input data in |
delta_Mu |
A function of |
delta_Nu |
A function of |
lambda |
A non-negative numeric scalar controlling the penalty for violating the constraint. |
alpha |
A numeric scalar representing the constraint tolerance (in |
beta |
A non-negative numeric scalar controlling the sharpness of the probability function (0.05 by default). |
centered |
A logical value indicating whether to apply centering in |
batch_prop |
Proportion of data in a batch (by default 1/5). |
max_iter |
Maximum number of iterations in the SGD (by default 1e3). |
tol |
Tolerance parameter (by default 1e-3). |
lr |
Learning rate parameter (by default 1e-2). |
verbose |
A logical value indicating whether to print progress updates. Default is |
A numeric matrix of size 1 x d (optimized parameters).
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.