learn_gd13: Learn Gradient Descent in 13 lines

View source: R/learn_gd.R

learn_gd13R Documentation

Learn Gradient Descent in 13 lines

Description

A 13 line version of the gradient descent function.

Usage

learn_gd13(X, y, alpha, hidden_dim)

Arguments

X

input data

y

output data

alpha

alpha to be used

hidden_dim

dimension of the hidden layer

References

http://qua.st/handcoding-gradient-descent/ http://iamtrask.github.io/2015/07/27/python-network-part2/

See Also

learn_gd

Examples

# create new data
alpha = 0.5
hidden_dim = 4
X = matrix(c(0,0,1,0,1,1,1,0,1,1,1,1), nrow=4, byrow=TRUE)
y = matrix(c(0,1,1,0),nrow=4)

# run 13 lines function
learn_gd13(X, y, alpha, hidden_dim)

bquast/learNN documentation built on June 26, 2022, 2:08 a.m.