Description Super class Public fields Methods Note See Also Examples
Setup a sequential (uni-directional) deep feed forward neural network. The Sequential is used as a wrapper for the modules.
neuralnetr::ClassModule
-> Sequential
loss
The loss module
modules
the list of current modules
new()
setup the neural network
Sequential$new(modules, loss)
modules
list of modules
loss
the loss module
sgd()
train neural network using stochastic gradient descent
Sequential$sgd(X, Y, iters = 100, lrate = 0.005, verbose = F, seed = 1)
X
the X input (m x b)
Y
the Y (target) input
iters
amount of iterations.
lrate
the learning rate.
verbose
print results every epoch.
seed
random seed.
cumulative loss for every iteration.
mini_gd()
train neural network using minibatch gradient descent.
Sequential$mini_gd( X, Y, iters = 100, lrate = 0.005, K = 5, verbose = F, seed = 1 )
X
the X input (m x b)
Y
the Y (target) input
iters
amount of iterations.
lrate
the learning rate.
K
the size of the minibatch.
verbose
print results every epoch.
seed
random seed.
cumulative loss for every iteration.
forward()
Compute Ypred
Sequential$forward(Xt)
Xt
the input at time t
backward()
Update dLdW and dLdW0
Sequential$backward(delta)
delta
the backpropagated error
sgd_step()
gradient descent step
Sequential$sgd_step(lrate)
lrate
the learning rate
classify()
classify the labels of the input
Sequential$classify(X)
X
input X
print_accuarcy()
print accuracy during training
Sequential$print_accuarcy(it, X, Y, cur_loss, every = 250)
it
iteration number
X
data X
Y
target Y
cur_loss
the current loss
every
how often should the function return feeddback?
clone()
The objects of this class are cloneable with this method.
Sequential$clone(deep = FALSE)
deep
Whether to make a deep clone.
Note that delta can refer to dLdA or dLdZ over the course of the for loop, depending on the module m
Other architecture:
BatchNorm
,
Linear
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.