-
Notifications
You must be signed in to change notification settings - Fork 1
/
learn_do15.Rd
49 lines (41 loc) · 1.01 KB
/
learn_do15.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/learn_do.R
\name{learn_do15}
\alias{learn_do15}
\title{Learn Dropout in 15 lines}
\usage{
learn_do15(X, y, alpha, hidden_dim, dropout_percent, do_dropout = TRUE)
}
\arguments{
\item{X}{input data}
\item{y}{output data}
\item{alpha}{proportion of gradient descent}
\item{hidden_dim}{dimension of the hidden layer}
\item{dropout_percent}{percentage to be used for the dropout}
\item{do_dropout}{should dropout be used}
}
\description{
A 15 line version of the dropout function.
}
\examples{
# 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
}
\references{
\url{http://qua.st/handcoding-dropout/}
\url{http://iamtrask.github.io/2015/07/28/dropout/}
}
\seealso{
\code{\link{learn_do}}
}