Skip to content
AI & Machine Learning Rich #forward-pass#inference#mlp

Forward Pass: Inputs to Logits

Activations flow layer by layer. Linear, then nonlinearity, then linear again, ending in logits.

A free, animated forward pass: inputs to logits you can read here or embed on any website, from Scrollchart.

Forward Pass: Inputs to Logits

Forward Pass: Inputs to Logitsz = Wx + b at each layer, then ReLU nonlinearity. Final layer: logits softmaxed to class probabilities.batch size B propagates unchanged; same weights W reused per inference callInputHidden 1Hidden 2OutputSoftmaxforward passInference: no weight update, no backward pass. Complexity O(W) per sample where W = total parameters.

A small MLP (input -> hidden1 -> hidden2 -> output). Activations propagate left to right with z = Wx + b at each layer followed by a nonlinearity. Tensor shapes annotated at every edge. Final layer produces logits, optionally softmaxed for class probabilities. The same weights are reused across batches; the diagram cycles to show batched inference.

Good for

  • Neural network introductions and first-principles deep learning courses
  • Inference vs training explainers showing what happens at deployment time
  • Tensor-shape debugging tutorials illustrating fan-in and fan-out conventions

Source & accuracy

This forward pass: inputs to logits is an editorial illustration built to represent the concept accurately. Where it shows figures, they are typical or representative values chosen to make the relationship clear, not a single underlying dataset. The diagram and its explainer are reviewed and maintained centrally, and updated over time as understanding improves.

The path from input to prediction

The forward pass executes the computational graph from input to output. For a typical feedforward network: embed the input, apply a linear layer (matrix multiply) to project to a hidden dimension, apply a nonlinearity (activation function), apply another linear layer, and so on. Each operation is deterministic given the weights and input. The final layer produces logits (raw scores before softmax), which are converted to probabilities and used for loss computation. The forward pass is the inference mechanism: it runs at train time to compute loss and at test time to make predictions.

Computational cost and the role of nonlinearities

Linear layers are cheap (just matrix multiply), but stacking them without nonlinearities collapses to a single linear operation, reducing expressiveness to shallow models. Nonlinearities like ReLU break this linearity, allowing networks to learn nonlinear functions. The interleaving of linear and nonlinear operations is what gives deep networks their power. Modern architectures also interleave normalization (batch norm, layer norm) and residual connections to control information flow. Understanding the forward pass clarifies why depth matters: more linear-nonlinear alternations capture more complex decision boundaries. Debugging training often requires tracing activations through the forward pass to spot where gradients might vanish.

Embed this diagram

Add this animated forward pass: inputs to logits to your own site. Copy one line of HTML, or use the embed builder for theme and sizing options.

Reference

What this is
A free, embeddable, animated forward pass: inputs to logits for any website.
Who uses it
AI/ML blogs, CS educators, Science popularizers.
How to embed
Copy one line of HTML. No signup. No watermark. Works in WordPress, Webflow, Ghost, Substack, plain HTML.
File size
iframe embed, ~80 KB gzipped (loads on demand, does not block your page paint).
License
Free forever. Editorial explainer text included; updated centrally over time.

Embed format options

Copy the universal HTML snippet, the WordPress shortcode, or an iframe fallback - see the WordPress plugin page for details. Any format keeps the same Core Web Vitals profile and the same explainer text.

Embed snippet
<div data-scrollchart="forward-pass" data-scrollchart-v="1"></div>
<script src="https://scrollchart.com/embed.js" async></script>

Frequently asked questions

Where can I get a free animated "Forward Pass: Inputs to Logits" for my website?
Scrollchart provides "Forward Pass: Inputs to Logits" as a free, embeddable animated diagram you can add to any website with one line of HTML. No signup is required and there is no watermark. The diagram and its explainer text are served from scrollchart.com, so the embed stays current without any maintenance on your end.
How do I embed a forward pass: inputs to logits in a developer or tech blog?
Copy the one-line snippet from the Scrollchart diagram page and paste it into your post HTML. It works in any static site generator, CMS, or hand-coded HTML page. The embed is a thin loader, not an iframe, so the content is fully in your DOM.