
Feed-forward neural networks
morie_neural_network.RdForward propagation, analytic back-propagation gradients and gradient-descent training for a feed-forward network.
Usage
morie_ann_forward(X, W, activations = NULL)
morie_ann_gradients(X, y, W, activations = NULL)
morie_ann_train(X, y, W, eta = 0.1, n_iter = 500L, activations = NULL, tol = 1e-12)Value
A list holding the fitted quantities for the method called: point estimates, fitted values and any diagnostics it produces. See the individual method descriptions above for the components each returns.
Details
These functions mirror, in R, the implementations in the Python package
morie; the two are checked against each other by the parity
tests in tests/testthat/.
Examples
set.seed(1)
X <- matrix(rnorm(20), 10, 2)
W <- list(matrix(rnorm(6, 0, 0.4), 3, 2), matrix(rnorm(3, 0, 0.4), 1, 3))
r <- morie_ann_forward(X, W)
str(r, max.level = 1)
#> List of 4
#> $ output : num [1:10, 1] -0.425 -0.44 -0.363 -0.444 -0.464 ...
#> $ layers :List of 3
#> $ nets :List of 2
#> $ activations: chr [1:2] "logistic" "identity"