Learn R Programming

gradDescent (version 3.0)

SSGD: Semi Stochastic Gradient Descent (SSGD) Method Learning Function

Description

A function to build prediction model using SSGD method.

Usage

SSGD(dataTrain, alpha = 0.1, maxIter = 10, lamda = 0, innerIter = 10,
  seed = NULL)

Arguments

dataTrain

a data.frame that representing training data (\(m \times n\)), where \(m\) is the number of instances and \(n\) is the number of variables where the last column is the output variable. dataTrain must have at least two columns and ten rows of data that contain only numbers (integer or float).

alpha

a float value representing learning rate. Default value is 0.1

maxIter

the maximal number of iterations in outerloop.

lamda

a float value to generate random value from innerIter with probability for innerloop.

innerIter

the maximal number of iterations in innerloop.

seed

a integer value for static random. Default value is NULL, which means the function will not do static random.

Value

a vector matrix of theta (coefficient) for linear model.

Details

This function combines elements from both GD and SGD. SSGD starts by computing the full gradient once and then proceeds with stochastic updates by choosing one of the gradients at a time.

References

George Papamakarios Comparison of Modern Stochastic Optimization Algorithms, (2014)

See Also

SVRG, SARAH, SARAHPlus

Examples

Run this code
# NOT RUN {
##################################
## Learning and Build Model with SSGD
## load R Package data
data(gradDescentRData)
## get z-factor data
dataSet <- gradDescentRData$CompressilbilityFactor
## split dataset
splitedDataSet <- splitData(dataSet)
## build model with SSGD
SSGDmodel <- SSGD(splitedDataSet$dataTrain)
#show result
print(SSGDmodel)

# }

Run the code above in your browser using DataLab