#' @title Forward pass a set of inputs throughout the network
#' @description This function does a forward propagation.
#' @param inputs A matrix of size (N, 1), where N is the size
#' of the layer that is going to receive such inputs. (matrix)
#' @param network A network object generated by create_network (list)
#' @author Eduardo Kapp
forward_pass <- function(inputs, network) {
layer_sequence <- seq_len(network$n_layers)
for (layer in layer_sequence) {
# Compute layer outputs
raw_layer_output <- compute_layer(
inputs,
network$layers[[layer]]
)
layer_output <- network$layers[[layer]]$activation(raw_layer_output)
# the new inputs will be the last layer outputs
inputs <- layer_output
}
return(layer_output)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.