N Neurarch Architectures Checks Docs Open the app

Architectures / Recommendation

๐Ÿ“ Wide & Deep

Memorization (wide linear) + generalization (deep MLP) joint trained โ€” Cheng et al. 2016

Layers
13
Parameters
3.65M
Input
10000
Output
1
Verifier
Clean

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

Open Wide & Deep on the canvas Free, no account needed

When to pick it

Pick as a simpler, more interpretable alternative to DLRM for CTR. Linear part captures memorized rules, deep part generalizes.

Structure

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

LayerTypeParametersOutput shape
1Wide Input (cross feats)Inputshape=[10000]10000
2Wide LinearLinearoutFeatures=1, inFeatures=100001
3Deep Input (sparse cat)Inputshape=[50]50
4EmbeddingsEmbeddingvocabSize=10000050 ร— 32
5FlattenFlatten1600
6Deep FC 1LinearoutFeatures=256, inFeatures=1600256
7ReLU 1ReLU256
8Deep FC 2LinearoutFeatures=128, inFeatures=256128
9ReLU 2ReLU128
10Deep OutLinearoutFeatures=1, inFeatures=1281
11Wide + DeepAdd1
12Sigmoid CTRSigmoid1
13P(click)Output1

What the verifier says

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

info"Sigmoid CTR" feeds directly into Output. PyTorch's nn.CrossEntropyLoss already applies log-softmax internally, an explicit Softmax causes double-application and degrades training stability. Fix: Remove Softmax/Sigmoid for training. Restore it in a separate inference wrapper or ONNX export. (Sigmoid CTR)
output-activation
infoSigmoid saturates to [0,1] / [-1,1], and its gradient approaches zero for large inputs. In networks deeper than 5 layers, this halts learning in early layers. Fix: Use ReLU, GELU, or SiLU for hidden layers. Keep Sigmoid only at binary classification outputs; Tanh in specific contexts (GAN generators, LSTM gates). (Sigmoid CTR)
vanishing-gradient
info10 layers with no BatchNorm, LayerNorm, or GroupNorm. Without normalization, activations can explode or vanish across layers, causing slow or unstable training. Fix: Add BatchNorm after Conv2d (CV tasks), LayerNorm after attention/FFN (NLP/LLM), or GroupNorm for small batch sizes.
deep-no-norm

The PyTorch it exports

Generated from the graph above. First 46 lines; the app exports the whole file, plus the training loop, the data contract and a deploy bundle.

# 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 WideDeep(nn.Module):
    def __init__(self):
        super().__init__()

        self.linear_1 = nn.Linear(10000, 1)
        self.embedding_1 = nn.Embedding(100000, 32)
        self.linear_2 = nn.Linear(1600, 256)
        self.linear_3 = nn.Linear(256, 128)
        self.linear_4 = nn.Linear(128, 1)

    def forward(self, src, tgt=None):
        # Wide Input (cross feats) shape: [10000]
        # Deep Input (sparse cat) shape: [50]
        linear_ide_fc = self.linear_1(src)
        embedding_ep_emb = self.embedding_1(tgt)
        flatten_p_flat = torch.flatten(embedding_ep_emb, 1)
        linear_ep_fc1 = self.linear_2(flatten_p_flat)
        relu__relu1 = F.relu(linear_ep_fc1)
        linear_ep_fc2 = self.linear_3(relu__relu1)
        relu__relu2 = F.relu(linear_ep_fc2)
        linear_ep_out = self.linear_4(relu__relu2)
        add_merge = linear_ide_fc + linear_ep_out
        sigmoid_igmoid = torch.sigmoid(add_merge)
        # Output
        return sigmoid_igmoid


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

    src = torch.randint(0, 10000, (1, 10000))  # (batch, src_seq_len)
    tgt = torch.randint(0, 50, (1, 50))  # (batch, tgt_seq_len)
    with torch.no_grad():
        output = model(src, tgt)

    print(f'Src shape    : {tuple(src.shape)}')

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 Recommendation

๐Ÿ—ผ Two-Tower
User+Item dual encoder for retrieval โ€” embeddings โ†’ MLP per side โ†’ dot product score
12 layers ยท 70.43M
๐Ÿ›’ DLRM
Meta's Deep Learning Recommendation Model โ€” bottom MLP for dense, embedding for sparse, feature interaction, top MLP
14 layers ยท 32.35M
๐Ÿค Neural Collaborative Filtering
He et al
16 layers ยท 105.61M
๐Ÿ•ธ GraphSAGE Recommender
Inductive node embeddings via neighbor sampling + aggregation โ€” for graph-based recommenders
10 layers ยท 263.0K