{
  "schemaVersion": 1,
  "slug": "resnet18",
  "title": "Follow shortcuts through eighteen layers",
  "className": "ReducedResNet18",
  "question": "What can flow through a shortcut when a residual branch changes?",
  "description": "Explore the full ResNet-18 block pattern at reduced width, with identity and projection shortcuts, batch normalization and post-addition ReLU.",
  "category": "Vision milestones",
  "tags": [
    "ResNet",
    "ResNet-18",
    "Residual learning",
    "Skip connections"
  ],
  "curator": "TensorViz",
  "attribution": "Original TensorViz teaching example. PyTorch provides the underlying operators.",
  "license": "No separate redistribution license has been declared for these project examples.",
  "limitations": "Untrained 64×64 reference with reduced widths and ten output classes. Unlike the earlier generic residual example, this follows the ResNet-18 basic-block pattern. Numerical shortcut checks do not establish training performance or accuracy; BatchNorm runs with initial evaluation statistics.",
  "openingStep": "identity",
  "provenance": {
    "capturedAt": "2026-09-17T06:26:29.596489+00:00",
    "productRevision": "cf0ab1c9c58c1dc640235b742fa032cade00b43c",
    "sourceSha256": "7d174000085621c697f0c024c9f4c596f637ffdbcab9ed091cdf6b4e4a173005",
    "python": "3.13.13",
    "torch": "2.7.1",
    "execution": {
      "inputs": {
        "args": [
          {
            "shape": [
              1,
              3,
              64,
              64
            ],
            "dtype": "float32",
            "fill": "randn"
          }
        ]
      },
      "device": "cpu",
      "mode": "eval",
      "seed": 0,
      "deterministic": true
    },
    "outcome": "passed",
    "outputShape": [
      1,
      10
    ],
    "method": "TensorViz multifile projection and isolated execution worker",
    "scope": "Reduced-width ResNet-18 CPU forward, zero-branch and shortcut gradient checks, projected-shape agreement and stage-shape/global-average verification.",
    "numericalChecks": [
      "A zero residual branch leaves ReLU(x), including the original post-addition activation",
      "The shortcut carries unit gradients on positive inputs when the residual branch is zero",
      "Stride-two projection shortcuts match the residual branch channel and spatial dimensions",
      "Four [2,2,2,2] stages produce 16/8/4/2-pixel maps before global averaging"
    ]
  },
  "layers": [
    {
      "id": "input",
      "label": "input",
      "op": "Input",
      "kind": "input",
      "parent": null,
      "params": {
        "shape": "1,3,64,64"
      }
    },
    {
      "id": "stem",
      "label": "stem",
      "op": "Conv2d",
      "kind": "layer",
      "parent": null,
      "params": {
        "in_channels": 3,
        "out_channels": 8,
        "kernel_size": 7,
        "stride": 2,
        "padding": 3,
        "bias": false
      },
      "source": {
        "line": 71,
        "endLine": 71
      }
    },
    {
      "id": "stem_norm",
      "label": "stem_norm",
      "op": "BatchNorm2d",
      "kind": "layer",
      "parent": null,
      "params": {
        "num_features": 8
      },
      "source": {
        "line": 72,
        "endLine": 72
      }
    },
    {
      "id": "stem_relu",
      "label": "stem_relu",
      "op": "ReLU",
      "kind": "layer",
      "parent": null,
      "params": {},
      "source": {
        "line": 73,
        "endLine": 73
      }
    },
    {
      "id": "pool",
      "label": "pool",
      "op": "MaxPool2d",
      "kind": "layer",
      "parent": null,
      "params": {
        "kernel_size": 3,
        "stride": 2,
        "padding": 1
      },
      "source": {
        "line": 74,
        "endLine": 74
      }
    },
    {
      "id": "stage1",
      "label": "stage1",
      "op": "Module",
      "kind": "module",
      "parent": null,
      "params": {
        "arg_0": 8
      },
      "source": {
        "line": 75,
        "endLine": 75
      }
    },
    {
      "id": "stage2",
      "label": "stage2",
      "op": "Module",
      "kind": "module",
      "parent": null,
      "params": {
        "arg_0": 8,
        "arg_1": 16
      },
      "source": {
        "line": 76,
        "endLine": 76
      }
    },
    {
      "id": "stage3",
      "label": "stage3",
      "op": "Module",
      "kind": "module",
      "parent": null,
      "params": {
        "arg_0": 16,
        "arg_1": 32
      },
      "source": {
        "line": 77,
        "endLine": 77
      }
    },
    {
      "id": "stage4",
      "label": "stage4",
      "op": "Module",
      "kind": "module",
      "parent": null,
      "params": {
        "arg_0": 32,
        "arg_1": 64
      },
      "source": {
        "line": 78,
        "endLine": 78
      }
    },
    {
      "id": "average",
      "label": "average",
      "op": "AdaptiveAvgPool2d",
      "kind": "layer",
      "parent": null,
      "params": {
        "output_size": 1
      },
      "source": {
        "line": 79,
        "endLine": 79
      }
    },
    {
      "id": "flatten",
      "label": "flatten",
      "op": "Flatten",
      "kind": "layer",
      "parent": null,
      "params": {
        "start_dim": 1
      },
      "source": {
        "line": 80,
        "endLine": 80
      }
    },
    {
      "id": "head",
      "label": "head",
      "op": "Linear",
      "kind": "layer",
      "parent": null,
      "params": {
        "in_features": 64,
        "out_features": 10
      },
      "source": {
        "line": 81,
        "endLine": 81
      }
    },
    {
      "id": "output",
      "label": "output",
      "op": "Output",
      "kind": "output",
      "parent": null,
      "params": {}
    },
    {
      "id": "stage1.first",
      "label": "stage1.first",
      "op": "Module",
      "kind": "module",
      "parent": "stage1",
      "params": {},
      "source": {
        "line": 50,
        "endLine": 50
      }
    },
    {
      "id": "stage1.second",
      "label": "stage1.second",
      "op": "Module",
      "kind": "module",
      "parent": "stage1",
      "params": {},
      "source": {
        "line": 51,
        "endLine": 51
      }
    },
    {
      "id": "stage1.first.conv1",
      "label": "stage1.first.conv1",
      "op": "Conv2d",
      "kind": "layer",
      "parent": "stage1.first",
      "params": {
        "kernel_size": 3,
        "padding": 1,
        "bias": false
      },
      "source": {
        "line": 15,
        "endLine": 15
      }
    },
    {
      "id": "stage1.first.bn1",
      "label": "stage1.first.bn1",
      "op": "BatchNorm2d",
      "kind": "layer",
      "parent": "stage1.first",
      "params": {},
      "source": {
        "line": 16,
        "endLine": 16
      }
    },
    {
      "id": "stage1.first.relu1",
      "label": "stage1.first.relu1",
      "op": "ReLU",
      "kind": "layer",
      "parent": "stage1.first",
      "params": {},
      "source": {
        "line": 17,
        "endLine": 17
      }
    },
    {
      "id": "stage1.first.conv2",
      "label": "stage1.first.conv2",
      "op": "Conv2d",
      "kind": "layer",
      "parent": "stage1.first",
      "params": {
        "kernel_size": 3,
        "padding": 1,
        "bias": false
      },
      "source": {
        "line": 18,
        "endLine": 18
      }
    },
    {
      "id": "stage1.first.bn2",
      "label": "stage1.first.bn2",
      "op": "BatchNorm2d",
      "kind": "layer",
      "parent": "stage1.first",
      "params": {},
      "source": {
        "line": 19,
        "endLine": 19
      }
    },
    {
      "id": "add@stage1.first#0",
      "label": "add@stage1.first#0",
      "op": "torch.add",
      "kind": "layer",
      "parent": "stage1.first",
      "params": {},
      "source": {
        "line": 24,
        "endLine": 24
      }
    },
    {
      "id": "stage1.first.relu_out",
      "label": "stage1.first.relu_out",
      "op": "ReLU",
      "kind": "layer",
      "parent": "stage1.first",
      "params": {},
      "source": {
        "line": 20,
        "endLine": 20
      }
    },
    {
      "id": "stage1.second.conv1",
      "label": "stage1.second.conv1",
      "op": "Conv2d",
      "kind": "layer",
      "parent": "stage1.second",
      "params": {
        "kernel_size": 3,
        "padding": 1,
        "bias": false
      },
      "source": {
        "line": 15,
        "endLine": 15
      }
    },
    {
      "id": "stage1.second.bn1",
      "label": "stage1.second.bn1",
      "op": "BatchNorm2d",
      "kind": "layer",
      "parent": "stage1.second",
      "params": {},
      "source": {
        "line": 16,
        "endLine": 16
      }
    },
    {
      "id": "stage1.second.relu1",
      "label": "stage1.second.relu1",
      "op": "ReLU",
      "kind": "layer",
      "parent": "stage1.second",
      "params": {},
      "source": {
        "line": 17,
        "endLine": 17
      }
    },
    {
      "id": "stage1.second.conv2",
      "label": "stage1.second.conv2",
      "op": "Conv2d",
      "kind": "layer",
      "parent": "stage1.second",
      "params": {
        "kernel_size": 3,
        "padding": 1,
        "bias": false
      },
      "source": {
        "line": 18,
        "endLine": 18
      }
    },
    {
      "id": "stage1.second.bn2",
      "label": "stage1.second.bn2",
      "op": "BatchNorm2d",
      "kind": "layer",
      "parent": "stage1.second",
      "params": {},
      "source": {
        "line": 19,
        "endLine": 19
      }
    },
    {
      "id": "add@stage1.second#0",
      "label": "add@stage1.second#0",
      "op": "torch.add",
      "kind": "layer",
      "parent": "stage1.second",
      "params": {},
      "source": {
        "line": 24,
        "endLine": 24
      }
    },
    {
      "id": "stage1.second.relu_out",
      "label": "stage1.second.relu_out",
      "op": "ReLU",
      "kind": "layer",
      "parent": "stage1.second",
      "params": {},
      "source": {
        "line": 20,
        "endLine": 20
      }
    },
    {
      "id": "stage2.first",
      "label": "stage2.first",
      "op": "Module",
      "kind": "module",
      "parent": "stage2",
      "params": {},
      "source": {
        "line": 60,
        "endLine": 60
      }
    },
    {
      "id": "stage2.second",
      "label": "stage2.second",
      "op": "Module",
      "kind": "module",
      "parent": "stage2",
      "params": {},
      "source": {
        "line": 61,
        "endLine": 61
      }
    },
    {
      "id": "stage2.first.conv1",
      "label": "stage2.first.conv1",
      "op": "Conv2d",
      "kind": "layer",
      "parent": "stage2.first",
      "params": {
        "kernel_size": 3,
        "stride": 2,
        "padding": 1,
        "bias": false
      },
      "source": {
        "line": 30,
        "endLine": 32
      }
    },
    {
      "id": "stage2.first.bn1",
      "label": "stage2.first.bn1",
      "op": "BatchNorm2d",
      "kind": "layer",
      "parent": "stage2.first",
      "params": {},
      "source": {
        "line": 33,
        "endLine": 33
      }
    },
    {
      "id": "stage2.first.relu1",
      "label": "stage2.first.relu1",
      "op": "ReLU",
      "kind": "layer",
      "parent": "stage2.first",
      "params": {},
      "source": {
        "line": 34,
        "endLine": 34
      }
    },
    {
      "id": "stage2.first.conv2",
      "label": "stage2.first.conv2",
      "op": "Conv2d",
      "kind": "layer",
      "parent": "stage2.first",
      "params": {
        "kernel_size": 3,
        "padding": 1,
        "bias": false
      },
      "source": {
        "line": 35,
        "endLine": 35
      }
    },
    {
      "id": "stage2.first.bn2",
      "label": "stage2.first.bn2",
      "op": "BatchNorm2d",
      "kind": "layer",
      "parent": "stage2.first",
      "params": {},
      "source": {
        "line": 36,
        "endLine": 36
      }
    },
    {
      "id": "stage2.first.shortcut",
      "label": "stage2.first.shortcut",
      "op": "Conv2d",
      "kind": "layer",
      "parent": "stage2.first",
      "params": {
        "kernel_size": 1,
        "stride": 2,
        "bias": false
      },
      "source": {
        "line": 37,
        "endLine": 37
      }
    },
    {
      "id": "stage2.first.shortcut_norm",
      "label": "stage2.first.shortcut_norm",
      "op": "BatchNorm2d",
      "kind": "layer",
      "parent": "stage2.first",
      "params": {},
      "source": {
        "line": 38,
        "endLine": 38
      }
    },
    {
      "id": "add@stage2.first#0",
      "label": "add@stage2.first#0",
      "op": "torch.add",
      "kind": "layer",
      "parent": "stage2.first",
      "params": {},
      "source": {
        "line": 44,
        "endLine": 44
      }
    },
    {
      "id": "stage2.first.relu_out",
      "label": "stage2.first.relu_out",
      "op": "ReLU",
      "kind": "layer",
      "parent": "stage2.first",
      "params": {},
      "source": {
        "line": 39,
        "endLine": 39
      }
    },
    {
      "id": "stage2.second.conv1",
      "label": "stage2.second.conv1",
      "op": "Conv2d",
      "kind": "layer",
      "parent": "stage2.second",
      "params": {
        "kernel_size": 3,
        "padding": 1,
        "bias": false
      },
      "source": {
        "line": 15,
        "endLine": 15
      }
    },
    {
      "id": "stage2.second.bn1",
      "label": "stage2.second.bn1",
      "op": "BatchNorm2d",
      "kind": "layer",
      "parent": "stage2.second",
      "params": {},
      "source": {
        "line": 16,
        "endLine": 16
      }
    },
    {
      "id": "stage2.second.relu1",
      "label": "stage2.second.relu1",
      "op": "ReLU",
      "kind": "layer",
      "parent": "stage2.second",
      "params": {},
      "source": {
        "line": 17,
        "endLine": 17
      }
    },
    {
      "id": "stage2.second.conv2",
      "label": "stage2.second.conv2",
      "op": "Conv2d",
      "kind": "layer",
      "parent": "stage2.second",
      "params": {
        "kernel_size": 3,
        "padding": 1,
        "bias": false
      },
      "source": {
        "line": 18,
        "endLine": 18
      }
    },
    {
      "id": "stage2.second.bn2",
      "label": "stage2.second.bn2",
      "op": "BatchNorm2d",
      "kind": "layer",
      "parent": "stage2.second",
      "params": {},
      "source": {
        "line": 19,
        "endLine": 19
      }
    },
    {
      "id": "add@stage2.second#0",
      "label": "add@stage2.second#0",
      "op": "torch.add",
      "kind": "layer",
      "parent": "stage2.second",
      "params": {},
      "source": {
        "line": 24,
        "endLine": 24
      }
    },
    {
      "id": "stage2.second.relu_out",
      "label": "stage2.second.relu_out",
      "op": "ReLU",
      "kind": "layer",
      "parent": "stage2.second",
      "params": {},
      "source": {
        "line": 20,
        "endLine": 20
      }
    },
    {
      "id": "stage3.first",
      "label": "stage3.first",
      "op": "Module",
      "kind": "module",
      "parent": "stage3",
      "params": {},
      "source": {
        "line": 60,
        "endLine": 60
      }
    },
    {
      "id": "stage3.second",
      "label": "stage3.second",
      "op": "Module",
      "kind": "module",
      "parent": "stage3",
      "params": {},
      "source": {
        "line": 61,
        "endLine": 61
      }
    },
    {
      "id": "stage3.first.conv1",
      "label": "stage3.first.conv1",
      "op": "Conv2d",
      "kind": "layer",
      "parent": "stage3.first",
      "params": {
        "kernel_size": 3,
        "stride": 2,
        "padding": 1,
        "bias": false
      },
      "source": {
        "line": 30,
        "endLine": 32
      }
    },
    {
      "id": "stage3.first.bn1",
      "label": "stage3.first.bn1",
      "op": "BatchNorm2d",
      "kind": "layer",
      "parent": "stage3.first",
      "params": {},
      "source": {
        "line": 33,
        "endLine": 33
      }
    },
    {
      "id": "stage3.first.relu1",
      "label": "stage3.first.relu1",
      "op": "ReLU",
      "kind": "layer",
      "parent": "stage3.first",
      "params": {},
      "source": {
        "line": 34,
        "endLine": 34
      }
    },
    {
      "id": "stage3.first.conv2",
      "label": "stage3.first.conv2",
      "op": "Conv2d",
      "kind": "layer",
      "parent": "stage3.first",
      "params": {
        "kernel_size": 3,
        "padding": 1,
        "bias": false
      },
      "source": {
        "line": 35,
        "endLine": 35
      }
    },
    {
      "id": "stage3.first.bn2",
      "label": "stage3.first.bn2",
      "op": "BatchNorm2d",
      "kind": "layer",
      "parent": "stage3.first",
      "params": {},
      "source": {
        "line": 36,
        "endLine": 36
      }
    },
    {
      "id": "stage3.first.shortcut",
      "label": "stage3.first.shortcut",
      "op": "Conv2d",
      "kind": "layer",
      "parent": "stage3.first",
      "params": {
        "kernel_size": 1,
        "stride": 2,
        "bias": false
      },
      "source": {
        "line": 37,
        "endLine": 37
      }
    },
    {
      "id": "stage3.first.shortcut_norm",
      "label": "stage3.first.shortcut_norm",
      "op": "BatchNorm2d",
      "kind": "layer",
      "parent": "stage3.first",
      "params": {},
      "source": {
        "line": 38,
        "endLine": 38
      }
    },
    {
      "id": "add@stage3.first#0",
      "label": "add@stage3.first#0",
      "op": "torch.add",
      "kind": "layer",
      "parent": "stage3.first",
      "params": {},
      "source": {
        "line": 44,
        "endLine": 44
      }
    },
    {
      "id": "stage3.first.relu_out",
      "label": "stage3.first.relu_out",
      "op": "ReLU",
      "kind": "layer",
      "parent": "stage3.first",
      "params": {},
      "source": {
        "line": 39,
        "endLine": 39
      }
    },
    {
      "id": "stage3.second.conv1",
      "label": "stage3.second.conv1",
      "op": "Conv2d",
      "kind": "layer",
      "parent": "stage3.second",
      "params": {
        "kernel_size": 3,
        "padding": 1,
        "bias": false
      },
      "source": {
        "line": 15,
        "endLine": 15
      }
    },
    {
      "id": "stage3.second.bn1",
      "label": "stage3.second.bn1",
      "op": "BatchNorm2d",
      "kind": "layer",
      "parent": "stage3.second",
      "params": {},
      "source": {
        "line": 16,
        "endLine": 16
      }
    },
    {
      "id": "stage3.second.relu1",
      "label": "stage3.second.relu1",
      "op": "ReLU",
      "kind": "layer",
      "parent": "stage3.second",
      "params": {},
      "source": {
        "line": 17,
        "endLine": 17
      }
    },
    {
      "id": "stage3.second.conv2",
      "label": "stage3.second.conv2",
      "op": "Conv2d",
      "kind": "layer",
      "parent": "stage3.second",
      "params": {
        "kernel_size": 3,
        "padding": 1,
        "bias": false
      },
      "source": {
        "line": 18,
        "endLine": 18
      }
    },
    {
      "id": "stage3.second.bn2",
      "label": "stage3.second.bn2",
      "op": "BatchNorm2d",
      "kind": "layer",
      "parent": "stage3.second",
      "params": {},
      "source": {
        "line": 19,
        "endLine": 19
      }
    },
    {
      "id": "add@stage3.second#0",
      "label": "add@stage3.second#0",
      "op": "torch.add",
      "kind": "layer",
      "parent": "stage3.second",
      "params": {},
      "source": {
        "line": 24,
        "endLine": 24
      }
    },
    {
      "id": "stage3.second.relu_out",
      "label": "stage3.second.relu_out",
      "op": "ReLU",
      "kind": "layer",
      "parent": "stage3.second",
      "params": {},
      "source": {
        "line": 20,
        "endLine": 20
      }
    },
    {
      "id": "stage4.first",
      "label": "stage4.first",
      "op": "Module",
      "kind": "module",
      "parent": "stage4",
      "params": {},
      "source": {
        "line": 60,
        "endLine": 60
      }
    },
    {
      "id": "stage4.second",
      "label": "stage4.second",
      "op": "Module",
      "kind": "module",
      "parent": "stage4",
      "params": {},
      "source": {
        "line": 61,
        "endLine": 61
      }
    },
    {
      "id": "stage4.first.conv1",
      "label": "stage4.first.conv1",
      "op": "Conv2d",
      "kind": "layer",
      "parent": "stage4.first",
      "params": {
        "kernel_size": 3,
        "stride": 2,
        "padding": 1,
        "bias": false
      },
      "source": {
        "line": 30,
        "endLine": 32
      }
    },
    {
      "id": "stage4.first.bn1",
      "label": "stage4.first.bn1",
      "op": "BatchNorm2d",
      "kind": "layer",
      "parent": "stage4.first",
      "params": {},
      "source": {
        "line": 33,
        "endLine": 33
      }
    },
    {
      "id": "stage4.first.relu1",
      "label": "stage4.first.relu1",
      "op": "ReLU",
      "kind": "layer",
      "parent": "stage4.first",
      "params": {},
      "source": {
        "line": 34,
        "endLine": 34
      }
    },
    {
      "id": "stage4.first.conv2",
      "label": "stage4.first.conv2",
      "op": "Conv2d",
      "kind": "layer",
      "parent": "stage4.first",
      "params": {
        "kernel_size": 3,
        "padding": 1,
        "bias": false
      },
      "source": {
        "line": 35,
        "endLine": 35
      }
    },
    {
      "id": "stage4.first.bn2",
      "label": "stage4.first.bn2",
      "op": "BatchNorm2d",
      "kind": "layer",
      "parent": "stage4.first",
      "params": {},
      "source": {
        "line": 36,
        "endLine": 36
      }
    },
    {
      "id": "stage4.first.shortcut",
      "label": "stage4.first.shortcut",
      "op": "Conv2d",
      "kind": "layer",
      "parent": "stage4.first",
      "params": {
        "kernel_size": 1,
        "stride": 2,
        "bias": false
      },
      "source": {
        "line": 37,
        "endLine": 37
      }
    },
    {
      "id": "stage4.first.shortcut_norm",
      "label": "stage4.first.shortcut_norm",
      "op": "BatchNorm2d",
      "kind": "layer",
      "parent": "stage4.first",
      "params": {},
      "source": {
        "line": 38,
        "endLine": 38
      }
    },
    {
      "id": "add@stage4.first#0",
      "label": "add@stage4.first#0",
      "op": "torch.add",
      "kind": "layer",
      "parent": "stage4.first",
      "params": {},
      "source": {
        "line": 44,
        "endLine": 44
      }
    },
    {
      "id": "stage4.first.relu_out",
      "label": "stage4.first.relu_out",
      "op": "ReLU",
      "kind": "layer",
      "parent": "stage4.first",
      "params": {},
      "source": {
        "line": 39,
        "endLine": 39
      }
    },
    {
      "id": "stage4.second.conv1",
      "label": "stage4.second.conv1",
      "op": "Conv2d",
      "kind": "layer",
      "parent": "stage4.second",
      "params": {
        "kernel_size": 3,
        "padding": 1,
        "bias": false
      },
      "source": {
        "line": 15,
        "endLine": 15
      }
    },
    {
      "id": "stage4.second.bn1",
      "label": "stage4.second.bn1",
      "op": "BatchNorm2d",
      "kind": "layer",
      "parent": "stage4.second",
      "params": {},
      "source": {
        "line": 16,
        "endLine": 16
      }
    },
    {
      "id": "stage4.second.relu1",
      "label": "stage4.second.relu1",
      "op": "ReLU",
      "kind": "layer",
      "parent": "stage4.second",
      "params": {},
      "source": {
        "line": 17,
        "endLine": 17
      }
    },
    {
      "id": "stage4.second.conv2",
      "label": "stage4.second.conv2",
      "op": "Conv2d",
      "kind": "layer",
      "parent": "stage4.second",
      "params": {
        "kernel_size": 3,
        "padding": 1,
        "bias": false
      },
      "source": {
        "line": 18,
        "endLine": 18
      }
    },
    {
      "id": "stage4.second.bn2",
      "label": "stage4.second.bn2",
      "op": "BatchNorm2d",
      "kind": "layer",
      "parent": "stage4.second",
      "params": {},
      "source": {
        "line": 19,
        "endLine": 19
      }
    },
    {
      "id": "add@stage4.second#0",
      "label": "add@stage4.second#0",
      "op": "torch.add",
      "kind": "layer",
      "parent": "stage4.second",
      "params": {},
      "source": {
        "line": 24,
        "endLine": 24
      }
    },
    {
      "id": "stage4.second.relu_out",
      "label": "stage4.second.relu_out",
      "op": "ReLU",
      "kind": "layer",
      "parent": "stage4.second",
      "params": {},
      "source": {
        "line": 20,
        "endLine": 20
      }
    }
  ],
  "connections": [
    {
      "id": "edge-1",
      "source": "stage1.first.conv1",
      "target": "stage1.first.bn1",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-2",
      "source": "stage1.first.bn1",
      "target": "stage1.first.relu1",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-3",
      "source": "stage1.first.relu1",
      "target": "stage1.first.conv2",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-4",
      "source": "stage1.first.conv2",
      "target": "stage1.first.bn2",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-5",
      "source": "stage1.first.bn2",
      "target": "add@stage1.first#0",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-6",
      "source": "add@stage1.first#0",
      "target": "stage1.first.relu_out",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-7",
      "source": "stage1.second.conv1",
      "target": "stage1.second.bn1",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-8",
      "source": "stage1.second.bn1",
      "target": "stage1.second.relu1",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-9",
      "source": "stage1.second.relu1",
      "target": "stage1.second.conv2",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-10",
      "source": "stage1.second.conv2",
      "target": "stage1.second.bn2",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-11",
      "source": "stage1.second.bn2",
      "target": "add@stage1.second#0",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-12",
      "source": "add@stage1.second#0",
      "target": "stage1.second.relu_out",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-13",
      "source": "stage1.first.relu_out",
      "target": "stage1.second.conv1",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-14",
      "source": "stage1.first.relu_out",
      "target": "add@stage1.second#0",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-15",
      "source": "stage1.first",
      "target": "stage1.second",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-16",
      "source": "stage2.first.conv1",
      "target": "stage2.first.bn1",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-17",
      "source": "stage2.first.bn1",
      "target": "stage2.first.relu1",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-18",
      "source": "stage2.first.relu1",
      "target": "stage2.first.conv2",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-19",
      "source": "stage2.first.conv2",
      "target": "stage2.first.bn2",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-20",
      "source": "stage2.first.shortcut",
      "target": "stage2.first.shortcut_norm",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-21",
      "source": "stage2.first.shortcut_norm",
      "target": "add@stage2.first#0",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-22",
      "source": "stage2.first.bn2",
      "target": "add@stage2.first#0",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-23",
      "source": "add@stage2.first#0",
      "target": "stage2.first.relu_out",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-24",
      "source": "stage2.second.conv1",
      "target": "stage2.second.bn1",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-25",
      "source": "stage2.second.bn1",
      "target": "stage2.second.relu1",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-26",
      "source": "stage2.second.relu1",
      "target": "stage2.second.conv2",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-27",
      "source": "stage2.second.conv2",
      "target": "stage2.second.bn2",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-28",
      "source": "stage2.second.bn2",
      "target": "add@stage2.second#0",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-29",
      "source": "add@stage2.second#0",
      "target": "stage2.second.relu_out",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-30",
      "source": "stage2.first.relu_out",
      "target": "stage2.second.conv1",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-31",
      "source": "stage2.first.relu_out",
      "target": "add@stage2.second#0",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-32",
      "source": "stage2.first",
      "target": "stage2.second",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-33",
      "source": "stage3.first.conv1",
      "target": "stage3.first.bn1",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-34",
      "source": "stage3.first.bn1",
      "target": "stage3.first.relu1",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-35",
      "source": "stage3.first.relu1",
      "target": "stage3.first.conv2",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-36",
      "source": "stage3.first.conv2",
      "target": "stage3.first.bn2",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-37",
      "source": "stage3.first.shortcut",
      "target": "stage3.first.shortcut_norm",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-38",
      "source": "stage3.first.shortcut_norm",
      "target": "add@stage3.first#0",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-39",
      "source": "stage3.first.bn2",
      "target": "add@stage3.first#0",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-40",
      "source": "add@stage3.first#0",
      "target": "stage3.first.relu_out",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-41",
      "source": "stage3.second.conv1",
      "target": "stage3.second.bn1",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-42",
      "source": "stage3.second.bn1",
      "target": "stage3.second.relu1",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-43",
      "source": "stage3.second.relu1",
      "target": "stage3.second.conv2",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-44",
      "source": "stage3.second.conv2",
      "target": "stage3.second.bn2",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-45",
      "source": "stage3.second.bn2",
      "target": "add@stage3.second#0",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-46",
      "source": "add@stage3.second#0",
      "target": "stage3.second.relu_out",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-47",
      "source": "stage3.first.relu_out",
      "target": "stage3.second.conv1",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-48",
      "source": "stage3.first.relu_out",
      "target": "add@stage3.second#0",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-49",
      "source": "stage3.first",
      "target": "stage3.second",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-50",
      "source": "stage4.first.conv1",
      "target": "stage4.first.bn1",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-51",
      "source": "stage4.first.bn1",
      "target": "stage4.first.relu1",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-52",
      "source": "stage4.first.relu1",
      "target": "stage4.first.conv2",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-53",
      "source": "stage4.first.conv2",
      "target": "stage4.first.bn2",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-54",
      "source": "stage4.first.shortcut",
      "target": "stage4.first.shortcut_norm",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-55",
      "source": "stage4.first.shortcut_norm",
      "target": "add@stage4.first#0",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-56",
      "source": "stage4.first.bn2",
      "target": "add@stage4.first#0",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-57",
      "source": "add@stage4.first#0",
      "target": "stage4.first.relu_out",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-58",
      "source": "stage4.second.conv1",
      "target": "stage4.second.bn1",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-59",
      "source": "stage4.second.bn1",
      "target": "stage4.second.relu1",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-60",
      "source": "stage4.second.relu1",
      "target": "stage4.second.conv2",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-61",
      "source": "stage4.second.conv2",
      "target": "stage4.second.bn2",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-62",
      "source": "stage4.second.bn2",
      "target": "add@stage4.second#0",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-63",
      "source": "add@stage4.second#0",
      "target": "stage4.second.relu_out",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-64",
      "source": "stage4.first.relu_out",
      "target": "stage4.second.conv1",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-65",
      "source": "stage4.first.relu_out",
      "target": "add@stage4.second#0",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-66",
      "source": "stage4.first",
      "target": "stage4.second",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-67",
      "source": "input",
      "target": "stem",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-68",
      "source": "stem",
      "target": "stem_norm",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-69",
      "source": "stem_norm",
      "target": "stem_relu",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-70",
      "source": "stem_relu",
      "target": "pool",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-71",
      "source": "pool",
      "target": "stage1.first.conv1",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-72",
      "source": "pool",
      "target": "add@stage1.first#0",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-73",
      "source": "pool",
      "target": "stage1",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-74",
      "source": "stage1.second.relu_out",
      "target": "stage2.first.conv1",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-75",
      "source": "stage1.second.relu_out",
      "target": "stage2.first.shortcut",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-76",
      "source": "stage1",
      "target": "stage2",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-77",
      "source": "stage2.second.relu_out",
      "target": "stage3.first.conv1",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-78",
      "source": "stage2.second.relu_out",
      "target": "stage3.first.shortcut",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-79",
      "source": "stage2",
      "target": "stage3",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-80",
      "source": "stage3.second.relu_out",
      "target": "stage4.first.conv1",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-81",
      "source": "stage3.second.relu_out",
      "target": "stage4.first.shortcut",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-82",
      "source": "stage3",
      "target": "stage4",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-83",
      "source": "stage4.second.relu_out",
      "target": "average",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-84",
      "source": "stage4",
      "target": "average",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-85",
      "source": "average",
      "target": "flatten",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-86",
      "source": "flatten",
      "target": "head",
      "sourcePort": null,
      "targetPort": null
    },
    {
      "id": "edge-87",
      "source": "head",
      "target": "output",
      "sourcePort": null,
      "targetPort": null
    }
  ],
  "steps": [
    {
      "id": "stem",
      "target": "stem",
      "title": "Build a spatial feature stem",
      "note": "The stride-two 7×7 convolution, BatchNorm, ReLU and max pool reduce 64×64 inputs to eight 16×16 feature maps before the residual stages."
    },
    {
      "id": "identity",
      "target": "stage1.first",
      "title": "Keep an identity shortcut around two convolutions",
      "note": "The first basic block preserves channels and resolution, so the input bypasses two 3×3 convolutions unchanged until addition. A ReLU follows the sum: with a zero residual branch the block returns ReLU(x)."
    },
    {
      "id": "projection",
      "target": "stage2.first.shortcut",
      "title": "Project when the dimensions change",
      "note": "At the next stage, channels double and spatial width halves. A stride-two 1×1 shortcut projection, followed by BatchNorm, makes its shape match the learned residual branch."
    },
    {
      "id": "average",
      "target": "average",
      "title": "Aggregate spatial features before classification",
      "note": "Four stages of two blocks leave 64 channels at 2×2. Global average pooling reduces each channel to one value, giving a 64-feature vector for the ten-class head."
    }
  ],
  "milestone": {
    "name": "ResNet-18",
    "year": 2015,
    "kind": "Architecture",
    "fidelity": "Original [2,2,2,2] basic-block stage pattern, 7×7 stride-2 stem and max pool, widths reduced to 8/16/32/64. Uses batch normalization, stride-2 projection shortcuts and ReLU after addition.",
    "papers": [
      {
        "title": "Deep Residual Learning for Image Recognition",
        "url": "https://arxiv.org/abs/1512.03385"
      }
    ]
  },
  "experiment": {
    "kind": "matrices",
    "title": "A shortcut around two convolutions.",
    "description": "Recorded intervention on an untrained identity-shortcut basic block. The full graph preserves ResNet-18's stage pattern, while this comparison isolates a single residual addition.",
    "controlLabel": "Residual branch intervention",
    "cases": [
      {
        "id": "scale-0-0",
        "label": "Residual output scale 0",
        "target": "stage1.first",
        "note": "The first basic-block form is tested on fixed synthetic features while its final convolution weights are scaled. The shortcut remains fixed. Original ResNet basic blocks apply ReLU after addition, so a zero branch returns ReLU(x), not every signed input unchanged. This demonstrates arithmetic and a gradient path, not an empirical training-stability result.",
        "matrices": [
          {
            "label": "Shortcut · channel 0",
            "values": [
              [
                -1.4,
                -1.3682539682539683,
                -1.3365079365079366,
                -1.3047619047619048,
                -1.273015873015873,
                -1.2412698412698413,
                -1.2095238095238097,
                -1.1777777777777778
              ],
              [
                -1.146031746031746,
                -1.1142857142857143,
                -1.0825396825396827,
                -1.0507936507936508,
                -1.019047619047619,
                -0.9873015873015873,
                -0.9555555555555556,
                -0.9238095238095239
              ],
              [
                -0.8920634920634921,
                -0.8603174603174604,
                -0.8285714285714286,
                -0.7968253968253969,
                -0.7650793650793651,
                -0.7333333333333334,
                -0.7015873015873016,
                -0.6698412698412699
              ],
              [
                -0.6380952380952382,
                -0.6063492063492064,
                -0.5746031746031747,
                -0.5428571428571429,
                -0.5111111111111112,
                -0.47936507936507944,
                -0.4476190476190477,
                -0.41587301587301595
              ],
              [
                -0.3841269841269841,
                -0.35238095238095235,
                -0.3206349206349206,
                -0.28888888888888886,
                -0.2571428571428571,
                -0.22539682539682537,
                -0.19365079365079363,
                -0.16190476190476188
              ],
              [
                -0.13015873015873014,
                -0.0984126984126984,
                -0.06666666666666665,
                -0.03492063492063491,
                -0.0031746031746031633,
                0.02857142857142858,
                0.060317460317460325,
                0.09206349206349207
              ],
              [
                0.12380952380952381,
                0.15555555555555556,
                0.1873015873015873,
                0.21904761904761905,
                0.2507936507936508,
                0.28253968253968254,
                0.3142857142857143,
                0.346031746031746
              ],
              [
                0.37777777777777777,
                0.4095238095238095,
                0.44126984126984126,
                0.473015873015873,
                0.5047619047619047,
                0.5365079365079365,
                0.5682539682539682,
                0.6
              ]
            ]
          },
          {
            "label": "Residual branch · channel 0",
            "values": [
              [
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0
              ],
              [
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0
              ],
              [
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0
              ],
              [
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0
              ],
              [
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0
              ],
              [
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0
              ],
              [
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0
              ],
              [
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0
              ]
            ]
          },
          {
            "label": "After addition + ReLU · channel 0",
            "values": [
              [
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0
              ],
              [
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0
              ],
              [
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0
              ],
              [
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0
              ],
              [
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0
              ],
              [
                0,
                0,
                0,
                0,
                0,
                0.02857142857142858,
                0.060317460317460325,
                0.09206349206349207
              ],
              [
                0.12380952380952381,
                0.15555555555555556,
                0.1873015873015873,
                0.21904761904761905,
                0.2507936507936508,
                0.28253968253968254,
                0.3142857142857143,
                0.346031746031746
              ],
              [
                0.37777777777777777,
                0.4095238095238095,
                0.44126984126984126,
                0.473015873015873,
                0.5047619047619047,
                0.5365079365079365,
                0.5682539682539682,
                0.6
              ]
            ]
          }
        ],
        "vectors": [
          {
            "label": "Before addition · eight channels at pixel (4,4)",
            "values": [
              -0.2571428571428571,
              -0.1428571428571428,
              -0.028571428571428525,
              0.08571428571428577,
              0.20000000000000004,
              0.31428571428571433,
              0.4285714285714286,
              0.5428571428571429
            ]
          },
          {
            "label": "After addition · before ReLU",
            "values": [
              -0.2571428571428571,
              -0.1428571428571428,
              -0.028571428571428525,
              0.08571428571428577,
              0.20000000000000004,
              0.31428571428571433,
              0.4285714285714286,
              0.5428571428571429
            ]
          },
          {
            "label": "After ReLU",
            "values": [
              0,
              0,
              0,
              0.08571428571428577,
              0.20000000000000004,
              0.31428571428571433,
              0.4285714285714286,
              0.5428571428571429
            ]
          }
        ],
        "metrics": [
          {
            "label": "Residual branch scale",
            "value": 0
          },
          {
            "label": "Elements clipped by output ReLU",
            "value": 256
          }
        ]
      },
      {
        "id": "scale-0-5",
        "label": "Residual output scale 0.5",
        "target": "stage1.first",
        "note": "The first basic-block form is tested on fixed synthetic features while its final convolution weights are scaled. The shortcut remains fixed. Original ResNet basic blocks apply ReLU after addition, so a zero branch returns ReLU(x), not every signed input unchanged. This demonstrates arithmetic and a gradient path, not an empirical training-stability result.",
        "matrices": [
          {
            "label": "Shortcut · channel 0",
            "values": [
              [
                -1.4,
                -1.3682539682539683,
                -1.3365079365079366,
                -1.3047619047619048,
                -1.273015873015873,
                -1.2412698412698413,
                -1.2095238095238097,
                -1.1777777777777778
              ],
              [
                -1.146031746031746,
                -1.1142857142857143,
                -1.0825396825396827,
                -1.0507936507936508,
                -1.019047619047619,
                -0.9873015873015873,
                -0.9555555555555556,
                -0.9238095238095239
              ],
              [
                -0.8920634920634921,
                -0.8603174603174604,
                -0.8285714285714286,
                -0.7968253968253969,
                -0.7650793650793651,
                -0.7333333333333334,
                -0.7015873015873016,
                -0.6698412698412699
              ],
              [
                -0.6380952380952382,
                -0.6063492063492064,
                -0.5746031746031747,
                -0.5428571428571429,
                -0.5111111111111112,
                -0.47936507936507944,
                -0.4476190476190477,
                -0.41587301587301595
              ],
              [
                -0.3841269841269841,
                -0.35238095238095235,
                -0.3206349206349206,
                -0.28888888888888886,
                -0.2571428571428571,
                -0.22539682539682537,
                -0.19365079365079363,
                -0.16190476190476188
              ],
              [
                -0.13015873015873014,
                -0.0984126984126984,
                -0.06666666666666665,
                -0.03492063492063491,
                -0.0031746031746031633,
                0.02857142857142858,
                0.060317460317460325,
                0.09206349206349207
              ],
              [
                0.12380952380952381,
                0.15555555555555556,
                0.1873015873015873,
                0.21904761904761905,
                0.2507936507936508,
                0.28253968253968254,
                0.3142857142857143,
                0.346031746031746
              ],
              [
                0.37777777777777777,
                0.4095238095238095,
                0.44126984126984126,
                0.473015873015873,
                0.5047619047619047,
                0.5365079365079365,
                0.5682539682539682,
                0.6
              ]
            ]
          },
          {
            "label": "Residual branch · channel 0",
            "values": [
              [
                0.19890351454388155,
                0.23870514412265864,
                0.23894159076604485,
                0.23312359815067402,
                0.2273056055353032,
                0.22148761291993244,
                0.1881752739868743,
                0.08305016935753023
              ],
              [
                0.28318123202923784,
                0.3100618874195166,
                0.3416718573578632,
                0.3301124313435864,
                0.31855300532930964,
                0.30699357931503274,
                0.25993675052540927,
                0.13623478882547044
              ],
              [
                0.3196227156888541,
                0.3754539907718466,
                0.3923163692445685,
                0.3749233877213392,
                0.35753040619811,
                0.3401374246748807,
                0.28371274266885116,
                0.12805787380522746
              ],
              [
                0.21225382945452695,
                0.24842348651387564,
                0.25173294873224344,
                0.23378838833039198,
                0.2172006134994585,
                0.20087877024633038,
                0.17559742118734079,
                0.08438424062601134
              ],
              [
                0.09836679279777702,
                0.11935050892383484,
                0.11911709250774935,
                0.10493411445258868,
                0.08964866818279664,
                0.07410286530350059,
                0.08250428476137939,
                0.03434284805670926
              ],
              [
                0.012628508450365023,
                0.019348827228776743,
                0.010641772328246625,
                0.003140106363543203,
                -0.0032783636607434828,
                -0.009472832159865274,
                0.030270940505617464,
                0.00463204692534
              ],
              [
                -0.02785584039825907,
                -0.026511173616544037,
                -0.03915198344508893,
                -0.04450159096465915,
                -0.04985119848422939,
                -0.05520080600379958,
                -0.017409366811550503,
                -0.013817903892537602
              ],
              [
                -0.03530961516696142,
                -0.02916858855384181,
                -0.043207346607655836,
                -0.04489803866722864,
                -0.04658873072680145,
                -0.048279422786374294,
                -0.025487855282790742,
                -0.005846329355343578
              ]
            ]
          },
          {
            "label": "After addition + ReLU · channel 0",
            "values": [
              [
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0
              ],
              [
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0
              ],
              [
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0
              ],
              [
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0
              ],
              [
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0
              ],
              [
                0,
                0,
                0,
                0,
                0,
                0.019098596411563307,
                0.09058840082307779,
                0.09669553898883207
              ],
              [
                0.09595368341126474,
                0.12904438193901152,
                0.14814960385649836,
                0.17454602808295988,
                0.2009424523094214,
                0.22733887653588297,
                0.2968763474741638,
                0.3322138421392084
              ],
              [
                0.34246816261081636,
                0.3803552209699677,
                0.3980624946621854,
                0.42811783434864437,
                0.45817317403510327,
                0.4882285137215622,
                0.5427661129711775,
                0.5941536706446564
              ]
            ]
          }
        ],
        "vectors": [
          {
            "label": "Before addition · eight channels at pixel (4,4)",
            "values": [
              -0.2571428571428571,
              -0.1428571428571428,
              -0.028571428571428525,
              0.08571428571428577,
              0.20000000000000004,
              0.31428571428571433,
              0.4285714285714286,
              0.5428571428571429
            ]
          },
          {
            "label": "After addition · before ReLU",
            "values": [
              -0.16749418896006046,
              -0.12396340489019314,
              -0.08191184533429857,
              0.23432492643201572,
              0.14097239413953827,
              0.3619303958264429,
              0.39527280841182927,
              0.4326006357129066
            ]
          },
          {
            "label": "After ReLU",
            "values": [
              0,
              0,
              0,
              0.23432492643201572,
              0.14097239413953827,
              0.3619303958264429,
              0.39527280841182927,
              0.4326006357129066
            ]
          }
        ],
        "metrics": [
          {
            "label": "Residual branch scale",
            "value": 0.5
          },
          {
            "label": "Elements clipped by output ReLU",
            "value": 260
          }
        ]
      },
      {
        "id": "scale-1-0",
        "label": "Residual output scale 1",
        "target": "stage1.first",
        "note": "The first basic-block form is tested on fixed synthetic features while its final convolution weights are scaled. The shortcut remains fixed. Original ResNet basic blocks apply ReLU after addition, so a zero branch returns ReLU(x), not every signed input unchanged. This demonstrates arithmetic and a gradient path, not an empirical training-stability result.",
        "matrices": [
          {
            "label": "Shortcut · channel 0",
            "values": [
              [
                -1.4,
                -1.3682539682539683,
                -1.3365079365079366,
                -1.3047619047619048,
                -1.273015873015873,
                -1.2412698412698413,
                -1.2095238095238097,
                -1.1777777777777778
              ],
              [
                -1.146031746031746,
                -1.1142857142857143,
                -1.0825396825396827,
                -1.0507936507936508,
                -1.019047619047619,
                -0.9873015873015873,
                -0.9555555555555556,
                -0.9238095238095239
              ],
              [
                -0.8920634920634921,
                -0.8603174603174604,
                -0.8285714285714286,
                -0.7968253968253969,
                -0.7650793650793651,
                -0.7333333333333334,
                -0.7015873015873016,
                -0.6698412698412699
              ],
              [
                -0.6380952380952382,
                -0.6063492063492064,
                -0.5746031746031747,
                -0.5428571428571429,
                -0.5111111111111112,
                -0.47936507936507944,
                -0.4476190476190477,
                -0.41587301587301595
              ],
              [
                -0.3841269841269841,
                -0.35238095238095235,
                -0.3206349206349206,
                -0.28888888888888886,
                -0.2571428571428571,
                -0.22539682539682537,
                -0.19365079365079363,
                -0.16190476190476188
              ],
              [
                -0.13015873015873014,
                -0.0984126984126984,
                -0.06666666666666665,
                -0.03492063492063491,
                -0.0031746031746031633,
                0.02857142857142858,
                0.060317460317460325,
                0.09206349206349207
              ],
              [
                0.12380952380952381,
                0.15555555555555556,
                0.1873015873015873,
                0.21904761904761905,
                0.2507936507936508,
                0.28253968253968254,
                0.3142857142857143,
                0.346031746031746
              ],
              [
                0.37777777777777777,
                0.4095238095238095,
                0.44126984126984126,
                0.473015873015873,
                0.5047619047619047,
                0.5365079365079365,
                0.5682539682539682,
                0.6
              ]
            ]
          },
          {
            "label": "Residual branch · channel 0",
            "values": [
              [
                0.3978070290877631,
                0.4774102882453173,
                0.4778831815320897,
                0.46624719630134803,
                0.4546112110706064,
                0.4429752258398649,
                0.3763505479737486,
                0.16610033871506047
              ],
              [
                0.5663624640584757,
                0.6201237748390332,
                0.6833437147157264,
                0.6602248626871728,
                0.6371060106586193,
                0.6139871586300655,
                0.5198735010508185,
                0.2724695776509409
              ],
              [
                0.6392454313777082,
                0.7509079815436932,
                0.784632738489137,
                0.7498467754426784,
                0.71506081239622,
                0.6802748493497613,
                0.5674254853377023,
                0.2561157476104549
              ],
              [
                0.4245076589090539,
                0.49684697302775127,
                0.5034658974644869,
                0.46757677666078395,
                0.434401226998917,
                0.40175754049266077,
                0.35119484237468157,
                0.16876848125202268
              ],
              [
                0.19673358559555404,
                0.23870101784766967,
                0.2382341850154987,
                0.20986822890517737,
                0.17929733636559328,
                0.14820573060700118,
                0.16500856952275877,
                0.06868569611341852
              ],
              [
                0.025257016900730046,
                0.038697654457553486,
                0.02128354465649325,
                0.006280212727086406,
                -0.0065567273214869656,
                -0.01894566431973055,
                0.06054188101123493,
                0.00926409385068
              ],
              [
                -0.05571168079651814,
                -0.053022347233088074,
                -0.07830396689017786,
                -0.0890031819293183,
                -0.09970239696845878,
                -0.11040161200759915,
                -0.034818733623101006,
                -0.027635807785075205
              ],
              [
                -0.07061923033392284,
                -0.05833717710768362,
                -0.08641469321531167,
                -0.08979607733445728,
                -0.0931774614536029,
                -0.09655884557274859,
                -0.050975710565581485,
                -0.011692658710687157
              ]
            ]
          },
          {
            "label": "After addition + ReLU · channel 0",
            "values": [
              [
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0
              ],
              [
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0
              ],
              [
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0
              ],
              [
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0
              ],
              [
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0
              ],
              [
                0,
                0,
                0,
                0,
                0,
                0.009625764251698032,
                0.12085934132869525,
                0.10132758591417207
              ],
              [
                0.06809784301300567,
                0.10253320832246748,
                0.10899762041140944,
                0.13004443711830074,
                0.151091253825192,
                0.17213807053208338,
                0.2794669806626133,
                0.31839593824667084
              ],
              [
                0.30715854744385496,
                0.3511866324161259,
                0.35485514805452956,
                0.38321979568141573,
                0.41158444330830185,
                0.4399490909351879,
                0.5172782576883868,
                0.5883073412893128
              ]
            ]
          }
        ],
        "vectors": [
          {
            "label": "Before addition · eight channels at pixel (4,4)",
            "values": [
              -0.2571428571428571,
              -0.1428571428571428,
              -0.028571428571428525,
              0.08571428571428577,
              0.20000000000000004,
              0.31428571428571433,
              0.4285714285714286,
              0.5428571428571429
            ]
          },
          {
            "label": "After addition · before ReLU",
            "values": [
              -0.07784552077726384,
              -0.10506966692324347,
              -0.13525226209716862,
              0.38293556714974564,
              0.08194478827907652,
              0.40957507736717147,
              0.36197418825223,
              0.32234412856867023
            ]
          },
          {
            "label": "After ReLU",
            "values": [
              0,
              0,
              0,
              0.38293556714974564,
              0.08194478827907652,
              0.40957507736717147,
              0.36197418825223,
              0.32234412856867023
            ]
          }
        ],
        "metrics": [
          {
            "label": "Residual branch scale",
            "value": 1
          },
          {
            "label": "Elements clipped by output ReLU",
            "value": 261
          }
        ]
      },
      {
        "id": "scale-2-0",
        "label": "Residual output scale 2",
        "target": "stage1.first",
        "note": "The first basic-block form is tested on fixed synthetic features while its final convolution weights are scaled. The shortcut remains fixed. Original ResNet basic blocks apply ReLU after addition, so a zero branch returns ReLU(x), not every signed input unchanged. This demonstrates arithmetic and a gradient path, not an empirical training-stability result.",
        "matrices": [
          {
            "label": "Shortcut · channel 0",
            "values": [
              [
                -1.4,
                -1.3682539682539683,
                -1.3365079365079366,
                -1.3047619047619048,
                -1.273015873015873,
                -1.2412698412698413,
                -1.2095238095238097,
                -1.1777777777777778
              ],
              [
                -1.146031746031746,
                -1.1142857142857143,
                -1.0825396825396827,
                -1.0507936507936508,
                -1.019047619047619,
                -0.9873015873015873,
                -0.9555555555555556,
                -0.9238095238095239
              ],
              [
                -0.8920634920634921,
                -0.8603174603174604,
                -0.8285714285714286,
                -0.7968253968253969,
                -0.7650793650793651,
                -0.7333333333333334,
                -0.7015873015873016,
                -0.6698412698412699
              ],
              [
                -0.6380952380952382,
                -0.6063492063492064,
                -0.5746031746031747,
                -0.5428571428571429,
                -0.5111111111111112,
                -0.47936507936507944,
                -0.4476190476190477,
                -0.41587301587301595
              ],
              [
                -0.3841269841269841,
                -0.35238095238095235,
                -0.3206349206349206,
                -0.28888888888888886,
                -0.2571428571428571,
                -0.22539682539682537,
                -0.19365079365079363,
                -0.16190476190476188
              ],
              [
                -0.13015873015873014,
                -0.0984126984126984,
                -0.06666666666666665,
                -0.03492063492063491,
                -0.0031746031746031633,
                0.02857142857142858,
                0.060317460317460325,
                0.09206349206349207
              ],
              [
                0.12380952380952381,
                0.15555555555555556,
                0.1873015873015873,
                0.21904761904761905,
                0.2507936507936508,
                0.28253968253968254,
                0.3142857142857143,
                0.346031746031746
              ],
              [
                0.37777777777777777,
                0.4095238095238095,
                0.44126984126984126,
                0.473015873015873,
                0.5047619047619047,
                0.5365079365079365,
                0.5682539682539682,
                0.6
              ]
            ]
          },
          {
            "label": "Residual branch · channel 0",
            "values": [
              [
                0.7956140581755262,
                0.9548205764906346,
                0.9557663630641794,
                0.9324943926026961,
                0.9092224221412128,
                0.8859504516797297,
                0.7527010959474972,
                0.33220067743012094
              ],
              [
                1.1327249281169514,
                1.2402475496780665,
                1.3666874294314528,
                1.3204497253743457,
                1.2742120213172385,
                1.227974317260131,
                1.039747002101637,
                0.5449391553018818
              ],
              [
                1.2784908627554163,
                1.5018159630873864,
                1.569265476978274,
                1.4996935508853568,
                1.43012162479244,
                1.3605496986995227,
                1.1348509706754046,
                0.5122314952209098
              ],
              [
                0.8490153178181078,
                0.9936939460555025,
                1.0069317949289738,
                0.9351535533215679,
                0.868802453997834,
                0.8035150809853215,
                0.7023896847493631,
                0.33753696250404536
              ],
              [
                0.3934671711911081,
                0.47740203569533934,
                0.4764683700309974,
                0.41973645781035474,
                0.35859467273118656,
                0.29641146121400236,
                0.33001713904551755,
                0.13737139222683703
              ],
              [
                0.05051403380146009,
                0.07739530891510697,
                0.0425670893129865,
                0.012560425454172812,
                -0.013113454642973931,
                -0.0378913286394611,
                0.12108376202246986,
                0.01852818770136
              ],
              [
                -0.11142336159303629,
                -0.10604469446617615,
                -0.15660793378035573,
                -0.1780063638586366,
                -0.19940479393691757,
                -0.2208032240151983,
                -0.06963746724620201,
                -0.05527161557015041
              ],
              [
                -0.14123846066784568,
                -0.11667435421536725,
                -0.17282938643062334,
                -0.17959215466891457,
                -0.1863549229072058,
                -0.19311769114549718,
                -0.10195142113116297,
                -0.023385317421374313
              ]
            ]
          },
          {
            "label": "After addition + ReLU · channel 0",
            "values": [
              [
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0
              ],
              [
                0,
                0.12596183539235217,
                0.28414774689177014,
                0.26965607458069485,
                0.25516440226961956,
                0.2406727299585436,
                0.08419144654608146,
                0
              ],
              [
                0.38642737069192423,
                0.641498502769926,
                0.7406940484068453,
                0.70286815405996,
                0.6650422597130748,
                0.6272163653661893,
                0.433263669088103,
                0
              ],
              [
                0.21092007972286964,
                0.3873447397062961,
                0.4323286203257991,
                0.392296410464425,
                0.3576913428867228,
                0.3241500016202421,
                0.25477063713031545,
                0
              ],
              [
                0.009340187064123984,
                0.125021083314387,
                0.1558334493960768,
                0.13084756892146587,
                0.10145181558832944,
                0.07101463581717699,
                0.13636634539472392,
                0
              ],
              [
                0,
                0,
                0,
                0,
                0,
                0,
                0.18140122233993017,
                0.11059167976485207
              ],
              [
                0.012386162216487528,
                0.04951086108937941,
                0.030693653521231573,
                0.04104125518898244,
                0.05138885685673322,
                0.06173645852448423,
                0.24464824703951227,
                0.2907601304615956
              ],
              [
                0.2365393171099321,
                0.29284945530844225,
                0.2684404548392179,
                0.29342371834695846,
                0.31840698185469896,
                0.34339024536243934,
                0.4663025471228053,
                0.5766146825786257
              ]
            ]
          }
        ],
        "vectors": [
          {
            "label": "Before addition · eight channels at pixel (4,4)",
            "values": [
              -0.2571428571428571,
              -0.1428571428571428,
              -0.028571428571428525,
              0.08571428571428577,
              0.20000000000000004,
              0.31428571428571433,
              0.4285714285714286,
              0.5428571428571429
            ]
          },
          {
            "label": "After addition · before ReLU",
            "values": [
              0.10145181558832944,
              -0.06728219098934415,
              -0.24193309562290868,
              0.6801568485852055,
              -0.036110423441847006,
              0.5048644404486285,
              0.2953769479330314,
              0.10183111428019759
            ]
          },
          {
            "label": "After ReLU",
            "values": [
              0.10145181558832944,
              0,
              0,
              0.6801568485852055,
              0,
              0.5048644404486285,
              0.2953769479330314,
              0.10183111428019759
            ]
          }
        ],
        "metrics": [
          {
            "label": "Residual branch scale",
            "value": 2
          },
          {
            "label": "Elements clipped by output ReLU",
            "value": 238
          }
        ]
      }
    ]
  },
  "revision": "22389a64ed4ca366",
  "files": {
    "graph.tensorviz.json": {
      "url": "/models/resnet18/22389a64ed4ca366/graph.tensorviz.json",
      "sha256": "8c4c63cadd21bef03ddbec8fe585a2c050e5f3fafa6f4c5b9d89fe93cd7e2589",
      "bytes": 228495
    },
    "model.py": {
      "url": "/models/resnet18/22389a64ed4ca366/model.py",
      "sha256": "7d174000085621c697f0c024c9f4c596f637ffdbcab9ed091cdf6b4e4a173005",
      "bytes": 7915
    },
    "run.py": {
      "url": "/models/resnet18/22389a64ed4ca366/run.py",
      "sha256": "862a582f67b62a8ce34159d6624bcb0c77312bbfdc82012a95b40b037c83b409",
      "bytes": 658
    },
    "requirements.txt": {
      "url": "/models/resnet18/22389a64ed4ca366/requirements.txt",
      "sha256": "edb86016b42cb3cc6cdc0c490aab929d3bb098ced4515394f0b55766033e0daf",
      "bytes": 91
    },
    "preview.svg": {
      "url": "/models/resnet18/22389a64ed4ca366/preview.svg",
      "sha256": "075e7f1f872d9f25bbc63654357ca89e9e6aedda2b4db34659e408500173910e",
      "bytes": 2248
    }
  }
}
