mlp_crossentropy_gradient: Compute Multi-Class Cross-Entropy Gradient for an MLP

View source: R/mlp_gradient.R

mlp_crossentropy_gradientR Documentation

Compute Multi-Class Cross-Entropy Gradient for an MLP

Description

Internal helper for computing the gradient of softmax cross-entropy loss with respect to the MLP parameter vector.

Usage

mlp_crossentropy_gradient(x, y, weights, architecture, epsilon = 1e-15)

Arguments

x

Numeric input matrix.

y

Numeric one-hot encoded response matrix.

weights

Numeric parameter vector.

architecture

MLP architecture object.

epsilon

Small value used for numerical stability.

Value

A list containing loss, predictions, and gradient vector.


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