Composable Model Graph
← Curriculum map Lesson 02 / 08

Mathematical proof / lesson 02

Treat a forward pass as ordinary transforms

A dense layer can be inspected through the same primitive as any other state transition.

01 / Problem + boundary

Know what the primitive owns.

Problem

Neural terminology can make a simple forward chain feel like a separate architecture. CMG tests whether the generic primitive is expressive enough without importing a training framework.

System boundary

DenseLayer is a Transform. Activation, loss, and derivative utilities remain mathematical capabilities. The example performs a forward pass and evaluation, not training.

02 / Executable shape

State changes become visible.

Inspectable: Both dense-layer outputs, the prediction, target, mean-squared error, evaluation status, and feedback action.

03 / Deterministic lab

Move a scalar pre-activation through sigmoid and inspect its local sensitivity.

Static specimen / JavaScript adds controls without changing the lesson.

04 / Specimens

Same idea, honest surfaces.

const hiddenLayer = new DenseLayer({
  id: "dense-4-2",
  name: "Dense 4 -> 2",
  inputSize: 4,
  outputSize: 2,
  weights,
  bias: [0, 0],
  activation: sigmoid,
});

const run = await graph.run([1, 2, 4, 5], {
  target: [1],
});
05 / Interpretation boundary

What this does not imply.

There is no backpropagation, optimizer, or weight update here. The implemented proof is the inspectable forward chain.

06 / Understanding check

What is the hidden layer output in CMG?