Opus Motion ★ Star on GitHub

Data · neural-net-layers

Neural net layers

Columns of neuron circles joined by weighted connections: an activation wave flows layer by layer as glowing pulses (blue to yellow), line widths show the weights, and an output bar chart (softmax) updates; it repeats with fresh inputs.

A free, MIT-licensed animated chart from the Opus Motion Library — 616 motions for Remotion, React and plain HTML.

Neural net layers: three frames of the animated chart, start, middle and end
Neural net layers — start, middle and end of the 8.0-second motion.

What Neural net layers is for

AI / machine-learning explainers, ML courses, "how the model decides" beats, product AI-feature launch videos.

  • neural network
  • ai
  • machine learning
  • deep learning
  • layers
  • neurons
  • weights
  • activation
  • forward pass
  • explainer
  • data
  • softmax
  • bar chart
  • perceptron
  • llm
  • model
  • pulses
  • connections
  • synapse

Details

Category
Animated charts & data visualisation
Length
8.0 s (240 frames at 30 fps)
Formats
16:9, 1:1, 9:16
Weight
light
Transparent overlay
no
Seamless loop
no
Text props
labels title subtitle
Colour props
background ink ramp positive negative
Mood
hud
Roles
subject

Use Neural net layers in Remotion, React or HTML

Remotion project

terminal
# copy this motion into your Remotion project
node cli/mgl.mjs add neural-net-layers --to ../my-app/src

# render an mp4 (run in the library folder)
node cli/mgl.mjs render neural-net-layers --props '{"labels":["cat","dog","bird","fish"],"title":"How a network decides","subtitle":"forward pass · weights · activations","background":"#0B1020","ink":"#DCE4FF","ramp":["#2B5BFF","#2FD0E0","#F7E15A"],"positive":"#5C8DFF","negative":"#FF9A4A"}'

# or export for apps / editors: mp4 | webm-alpha | prores-alpha | gif | png | poster
node cli/mgl.mjs export neural-net-layers --as mp4 --props '{"labels":["cat","dog","bird","fish"],"title":"How a network decides","subtitle":"forward pass · weights · activations","background":"#0B1020","ink":"#DCE4FF","ramp":["#2B5BFF","#2FD0E0","#F7E15A"],"positive":"#5C8DFF","negative":"#FF9A4A"}'

React / Next.js

tsx
import {MotionPlayer} from 'opus-motion-library/web';

<MotionPlayer
  motion="neural-net-layers"
  props={{
    labels: ['cat', 'dog', 'bird', 'fish'],
    title: 'How a network decides',
    subtitle: 'forward pass · weights · activations',
    background: '#0B1020',
    ink: '#DCE4FF',
    ramp: ['#2B5BFF', '#2FD0E0', '#F7E15A'],
    positive: '#5C8DFF',
    negative: '#FF9A4A',
  }}
  playOnView
  loop="auto"
/>

Plain HTML / WordPress

html
<script src="opus-motion.element.js" defer></script>

<opus-motion motion="neural-net-layers"
  props='{"labels":["cat","dog","bird","fish"],"title":"How a network decides","subtitle":"forward pass · weights · activations","background":"#0B1020","ink":"#DCE4FF","ramp":["#2B5BFF","#2FD0E0","#F7E15A"],"positive":"#5C8DFF","negative":"#FF9A4A"}'>
</opus-motion>

Compose spec (multi-scene video)

json
{
  "width": 1920,
  "height": 1080,
  "fps": 30,
  "scenes": [
    {
      "motion": "neural-net-layers",
      "props": {
        "labels": [
          "cat",
          "dog",
          "bird",
          "fish"
        ],
        "title": "How a network decides",
        "subtitle": "forward pass · weights · activations",
        "background": "#0B1020",
        "ink": "#DCE4FF",
        "ramp": [
          "#2B5BFF",
          "#2FD0E0",
          "#F7E15A"
        ],
        "positive": "#5C8DFF",
        "negative": "#FF9A4A"
      }
    }
  ]
}

Neural net layers props

15 parameters — change any of them to make the motion yours.

PropDefaultWhat it does
layers[5,7,7,4]neurons per layer, e.g. [5,7,7,4] (2-7 layers, up to 14 each); the last is the output
inputs[]optional input values 0..1 for the first pass (empty = seeded)
labels["cat","dog","bird","fish"]output class names (bar chart rows)
title"How a network decides"title text
subtitle"forward pass · weights · activations"small mono caption under the title
cycle80frames per forward pass (a new input is fed each pass)
travel12frames the activation takes to cross one layer (8-12)
showWeightstrueline thickness + hue show each weight (false = uniform lines)
seed7seed for weights and inputs
background"#0B1020"background colour
ink"#DCE4FF"text / outline colour
ramp["#2B5BFF","#2FD0E0","#F7E15A"]activation colour ramp (low -> high), 2-4 colours
positive"#5C8DFF"positive-weight connection colour
negative"#FF9A4A"negative-weight connection colour
outputLabel"OUTPUT · SOFTMAX"small caption above the output bars

Notes & credits

Technique sources:

  • prompt-corpus: awesome-opus5-5-videos (MIT) — neural network explainers (9 cases), original implementation