BRAGA

02 Writing02-02 Notes02-02-448

General Neural Network Layer Mapping

Published 16 Apr 20262 min read
Contents
  1. 01Deep Breakdown
  2. 02Flowchart
a=σ(Wx+b)a = \sigma(Wx + b)
(1)

We are working on the general mapping performed by one feedforward neural network layer, a=σ(Wx+b)a = \sigma(Wx + b), with pre-activation z=Wx+bz = Wx + b, where xx is an input vector, WW is a weight matrix, bb is a bias vector, and σ\sigma is applied element-wise unless stated otherwise. The setting is a standard feedforward neural network layer with compatible dimensions, deterministic forward propagation, and activation functions such as sigmoid or ReLU.

Deep Breakdown

A general neural network layer takes an input vector, applies a linear transformation, then applies a non-linear activation. This is one of the core building blocks of modern machine learning.

The mapping happens in two stages:

  1. Linear stage: combine input features using learned weights and biases.
  2. Non-linear stage: apply an activation function so the network can represent non-linear relationships.

Without the activation, stacked layers collapse into one overall linear map. With the activation, the network can learn boundaries, interactions, and patterns that logistic regression alone cannot express.

For one layer:

z=Wx+bz = Wx + b
(2)
a=σ(z)a = \sigma(z)
(3)

or equivalently:

a=σ(Wx+b)a = \sigma(Wx + b)
(4)

Where:

  • xx is the input vector.
  • WW contains trainable weights.
  • bb contains trainable biases.
  • zz is the pre-activation vector.
  • aa is the output of the layer, often called the activation.
  • σ\sigma is the activation function, applied element-wise for standard dense layers.

In data analytics and data science, this layer mapping matters because it defines how raw or engineered features are turned into internal representations.

It is the basis of:

  • logistic units,
  • hidden layers,
  • output layers,
  • backpropagation,
  • representation learning,
  • deep learning model design.

For a dense layer with dind_{\text{in}} input features and doutd_{\text{out}} output units:

  • x∈Rdinx \in \mathbb{R}^{d_{\text{in}}}
  • W∈Rdout×dinW \in \mathbb{R}^{d_{\text{out}} \times d_{\text{in}}}
  • b∈Rdoutb \in \mathbb{R}^{d_{\text{out}}}
  • z∈Rdoutz \in \mathbb{R}^{d_{\text{out}}}
  • a∈Rdouta \in \mathbb{R}^{d_{\text{out}}} So the layer maps one vector in Rdin\mathbb{R}^{d_{\text{in}}} to another vector in Rdout\mathbb{R}^{d_{\text{out}}}.

This is called a mapping because it defines a function from inputs to outputs. The learned parameters WW and bb determine what the layer does. Training adjusts these parameters to reduce prediction error.

Flowchart

Input vector $x$Apply linear map$z = Wx + b$Compute onepre-activationper neuronApply activationelement-wise $a= \sigma(z)$Layer output /activation vector$a$Pass to nextlayer or outputstageInterpret aslearnedrepresentationor predictioncomponent

#machine-learning#machine-learning-algorithms#logistic-regression-and-neural-networks

Keyboard shortcuts

Single keys, ignored while typing in a field or with Cmd, Ctrl or Alt held.

0
Home
1 2 3 4
Work, Writing, Tools, About
j / k
Next / previous section on this page
n / p
Next / previous project or essay
u
Up one level
l
Deutsch
t
Light or dark theme
?
This list
Esc
Close