fit_sgd: Title

View source: R/fit-deep-MRA-sgd.R

fit_sgdR Documentation

Title

Description

Title

Usage

fit_sgd(
  y,
  locs,
  grid,
  y_obs = NULL,
  z = NULL,
  alpha = NULL,
  alpha_x1 = NULL,
  alpha_y1 = NULL,
  alpha_x2 = NULL,
  alpha_y2 = NULL,
  learn_rate = 0.001,
  rate_schedule = NULL,
  n_iter = 500,
  n_message = 50,
  penalized = FALSE,
  plot_during_fit = FALSE,
  use_spam = FALSE,
  adam_pars = NULL,
  use_adamw = TRUE,
  sparse_outer = TRUE,
  noisy = TRUE,
  ncores = 1L,
  nchunks = NULL
)

Arguments

y

The data

locs

An N x 2 matrix of spatial locations

grid

A grid object that is the output of make_grid

alpha

If specified, the top layer MRA parameters

alpha_x1

If specified, the first hidden layer MRA parameters for the x-axis variable

alpha_y1

If specified, the first hidden layer MRA parameters for the y-axis variable

alpha_x2

If specified, the second hidden layer MRA parameters for the x-axis variable

alpha_y2

If specified, the second hidden layer MRA parameters for the y-axis variable

learn_rate

The gradient descent learning rate

rate_schedule

If specified, the gradient descent learning rate schedule in decreasing values.

n_iter

The number of gradient descent iterations

n_message

The number of iterations between which to output a message

penalized

Fit using a penalty term

plot_during_fit

Plot the current parameter states every n_message iterations

use_spam

Whether to use the spam (use_spam = TRUE) or Matrix (use_spam = FALSE) package for sparse matrices

adam_pars

The adam parameter state to allow restarting the model

use_adamw

Use the adamW optimizer

sparse_outer

If TRUE, calculate the outer product in a sparse format. For all but the smallest models, this should be TRUE. I should make this automatic going forward

noisy

If TRUE, add random noise to the gradient.

ncores

The number of cores to use for parallelization

nchunks

The number of chunks to divide the distance calculation into. The default argument of NULL will use the same number of chunks as the number of cores.


jtipton25/sgMRA documentation built on Feb. 9, 2023, 4:53 a.m.