StatComp21088-package: Achieve the Three kinds of gradient descent algorithm

Description Details Author(s) Examples

Description

This package is developed to developed to achieve three kinds of gradient descent algorithm.Include Batch Gradient Descent,Stochastic Gradient Descent,Mini-batch gradient descent algorithm.And it will record the loss function value of the model after every iteration.

Details

Use train functions to train the model and get the result and the recorded cost.

Author(s)

Haifeng Chen

Maintainer: Haifeng Chen <cfhai@email.ustc.edu.cn>

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
  ## Not run: 
    x <- seq(0.1,10,0.01)
    n <- length(x)
    z <- rnorm(n)
    y <- 2*x+5+z
    theta <- train_MBGD(x,y,500,200,0.01,c(1,1))$theta
    print(theta)
    cost <- train_MBGD(x,y,500,200,0.01,c(1,1))$cost
    print(cost)
  
## End(Not run)

Sakoylf/StatComp21088 documentation built on Dec. 23, 2021, 10:22 p.m.