Skip to content

Repository files navigation

LayerLab

A visual neural network designer that allows you to design neural networks via drag and drop, with real-time parameter counting and PyTorch code generation.

Features

  • 🎨 Drag-and-Drop Interface: Design networks by dragging layers onto a 2D canvas
  • 🔗 Visual Connections: Draw connections between layers with visual feedback
  • 📊 Real-Time Statistics: Live parameter and FLOP counting with highlighting for large layers
  • ⚙️ In-Place Editing: Adjust hyperparameters directly on each node
  • 🔄 Power-of-Two Snapping: Optional snapping to powers of two when adjusting parameters
  • Validation: Automatic checking of layer compatibility with error/warning messages
  • 🐍 PyTorch Export: Generate complete PyTorch model code
  • 🔍 Workspace Zoom: Zoom in/out to manage complex architectures

Supported Layers

Input Layers

  • Input1D (for sequential/tabular data)
  • Input2D (for images)

Basic Layers

  • Linear (fully connected)
  • Conv2D (convolutional)
  • MaxPool2D, AvgPool2D
  • Dropout, Dropout2D
  • BatchNorm1D, BatchNorm2D
  • Flatten

Activation Functions

  • ReLU, LeakyReLU, PReLU
  • Sigmoid, Tanh
  • Softmax, Softplus, Mish

Attention

  • MultiheadAttention

Usage

Visit https://mikesha2.github.io/LayerLab/ to use the tool.

Or run locally:

  1. Clone the repository
  2. Open index.html in a web browser

Development

To minify the JavaScript:

npm install
npm run minify

License

MIT

Releases

Packages

Contributors

Languages