N Neurarch Architectures Checks Docs Open the app

Architectures / Computer Vision

๐Ÿ”— ResNet Block

ResNet residual block with skip connections

Layers
9
Parameters
74.0K
Input
64 ร— 32 ร— 32
Output
64 ร— 32 ร— 32
Verifier
Clean

Every number on this page is computed from the graph by the same functions the app runs, not written by hand.

Open ResNet Block on the canvas Free, no account needed

When to pick it

Pick when you need a depth-friendly CV backbone. Stack 2โ€“4 blocks for CIFAR, or use as the building block of ResNet-18/50 for ImageNet-scale.

Structure

9 layers. Output shapes are propagated from the input shape, batch dimension excluded.

LayerTypeParametersOutput shape
1InputInputshape=[64, 32, 32]64 ร— 32 ร— 32
2Conv2D_1Conv2DoutChannels=64, kernelSize=3, stride=164 ร— 32 ร— 32
3BatchNorm_1BatchNorm64 ร— 32 ร— 32
4ReLU_1ReLU64 ร— 32 ร— 32
5Conv2D_2Conv2DoutChannels=64, kernelSize=3, stride=164 ร— 32 ร— 32
6BatchNorm_2BatchNorm64 ร— 32 ร— 32
7AddAdd64 ร— 32 ร— 32
8ReLU_2ReLU64 ร— 32 ร— 32
9OutputOutput64 ร— 32 ร— 32

What the verifier says

The same 41 structural checks that run on every edit in the app, on this graph.

No finding. Shapes propagate end to end, every divisibility condition holds, and no advisory rule fires. See the checks.

The PyTorch it exports

Generated from the graph above.

# Architecture designed with Neurarch: https://neurarch.com
# PyTorch: compatible with Python 3.8+ and torch>=1.12
# Colab: pip install torch torchvision  (usually pre-installed)

import torch
import torch.nn as nn
import torch.nn.functional as F
from typing import Tuple

class ResNetBlock(nn.Module):
    def __init__(self):
        super().__init__()

        self.conv2d_1 = nn.Conv2d(64, 64, kernel_size=3, stride=1, padding=1)
        self.batchNorm_1 = nn.BatchNorm2d(64)
        self.conv2d_2 = nn.Conv2d(64, 64, kernel_size=3, stride=1, padding=1)
        self.batchNorm_2 = nn.BatchNorm2d(64)

    def forward(self, x):
        # Input shape: [64,32,32]
        conv2d_nv2d_1 = self.conv2d_1(x)
        batch_norm_Norm_1 = self.batchNorm_1(conv2d_nv2d_1)
        relu_relu_1 = F.relu(batch_norm_Norm_1)
        conv2d_nv2d_2 = self.conv2d_2(relu_relu_1)
        batch_norm_Norm_2 = self.batchNorm_2(conv2d_nv2d_2)
        add_add_1 = batch_norm_Norm_2
        relu_relu_2 = F.relu(add_add_1)
        # Output
        return relu_relu_2


if __name__ == '__main__':
    model = ResNetBlock()
    model.eval()

    x = torch.randn(1, 64, 32, 32)  # (batch, channels, height, width)
    with torch.no_grad():
        output = model(x)

    print(f'Input  shape : {tuple(x.shape)}')
    print(f'Output shape : {tuple(output.shape)}')
    total = sum(p.numel() for p in model.parameters())
    trainable = sum(p.numel() for p in model.parameters() if p.requires_grad)
    print(f'Parameters   : {total:,} total, {trainable:,} trainable')

For agents

This architecture is machine-readable end to end. An agent can list the set, fetch this graph, edit it, and have the edit verified before any GPU time is spent.

Also in Computer Vision

๐Ÿ–ผ๏ธ Simple CNN
Simple Convolutional Neural Network for image classification
9 layers ยท 804.6K
๐Ÿฉป U-Net
Encoder-decoder with skip connections โ€” Ronneberger et al
24 layers ยท 720.7K
๐Ÿ‘๏ธ ViT-B/16
Vision Transformer โ€” patch embedding stem + 1 encoder block
13 layers ยท 8.45M
๐ŸชŸ Swin-Tiny
Hierarchical vision transformer โ€” shifted-window attention builds a feature pyramid for dense prediction
81 layers ยท 28.26M