forward_pass: Forward Pass for an MLP

View source: R/mlp_engine.R

forward_passR Documentation

Forward Pass for an MLP

Description

Computes predictions from input data, an MLP architecture, and a parameter vector.

Usage

forward_pass(x, weights, architecture)

Arguments

x

A numeric matrix or data frame of input features.

weights

A numeric vector of MLP parameters.

architecture

An object created by mlp_architecture().

Value

A numeric matrix containing network outputs.

Examples

x <- matrix(rnorm(10), nrow = 5, ncol = 2)
arch <- mlp_architecture(
  input_dim = 2,
  layers = list(
    dense_layer(3, activation = "relu"),
    dense_layer(1, activation = "linear")
  )
)
w <- initialize_weights(arch, seed = 123)
forward_pass(x, w, arch)

metANN documentation built on May 16, 2026, 1:06 a.m.