learn_do15: Learn Dropout in 15 lines

Description Usage Arguments References See Also Examples

View source: R/learn_do.R

Description

Learn Dropout in 15 lines

Usage

1
learn_do15(X, y, alpha, hidden_dim, dropout_percent, do_dropout = TRUE)

Arguments

X

input data

y

output data

alpha

proportion of gradient descent

hidden_dim

dimension of the hidden layer

dropout_percent

percentage to be used for the dropout

do_dropout

should dropout be used

References

http://qua.st/handcoding-dropout/ http://iamtrask.github.io/2015/07/28/dropout/

See Also

learn_do

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
# construct data
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)

# set hyperparameters
alpha = 0.5
hidden_dim = 4
dropout_percent = 0.2
do_dropout = TRUE

# run 11 lines function
learn_do15(X, y, alpha, hidden_dim, dropout_percent, TRUE)

# view output
synapse_0
synapse_1

learNN documentation built on May 29, 2017, 9 a.m.