Skip to content

๐Ÿง  Interactive PyTorch Neural Network Simulation โ€” Learn deep learning through real-time visualization, live training, XOR playground, and auto-generated PyTorch code. Includes ArXiv-style research papers.

License

Notifications You must be signed in to change notification settings

romizone/pytorch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

6 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

PyTorch Neural Network Next.js TypeScript Tailwind CSS Vercel


PyTorch Logo
PyTorch Neural Network Simulation

An interactive web-based platform for learning neural network fundamentals through real-time simulations with auto-generated PyTorch code.

Live Demo Paper Chess Paper

License Stars Forks Last Commit PRs Welcome


๐Ÿ“ธ Preview

Feature Description
๐Ÿง  Neural Network Visualizer Interactive SVG network with real-time training, neuron inspection, and weight visualization
๐Ÿ“Š Training Charts Live loss curves and accuracy metrics with PyTorch code annotations
๐ŸŽฏ XOR Playground Decision boundary heatmap showing non-linear classification in action
๐Ÿ“š PyTorch Concepts Interactive guide to Tensors, Layers, Activations, Backprop, Optimizers, and Loss Functions
๐Ÿ”ง Training Pipeline Step-by-step walkthrough of the complete PyTorch training workflow

โœจ Features

๐Ÿง  Live Neural Network Simulation

  • Configurable architecture โ€” 2 to 6 layers, 1 to 8 neurons per hidden layer
  • Real-time training with live weight updates and neuron activation visualization
  • Forward pass animation โ€” watch data flow layer by layer
  • Click any neuron to inspect pre-activation (z), activation (a), bias (b), and formula
  • Weight visualization โ€” color (blue/red) and thickness encode weight values

โš™๏ธ Hyperparameter Controls

  • Learning rate slider (0.001 โ€“ 1.0)
  • Activation functions โ€” ReLU, Sigmoid, Tanh (switch in real-time)
  • Architecture modification โ€” add/remove layers and neurons dynamically

๐Ÿ”ฅ Auto-Generated PyTorch Code

Every change to the network architecture automatically generates valid PyTorch code:

class XORNet(nn.Module):
    def __init__(self):
        super(XORNet, self).__init__()
        self.fc1 = nn.Linear(2, 4)
        self.fc2 = nn.Linear(4, 4)
        self.fc3 = nn.Linear(4, 1)
        self.relu = nn.ReLU()

    def forward(self, x):
        x = self.relu(self.fc1(x))
        x = self.relu(self.fc2(x))
        return torch.sigmoid(self.fc3(x))

๐Ÿ“Š Real-Time Training Metrics

  • Loss curve (MSE) with area chart visualization
  • Accuracy tracking with percentage display
  • PyTorch code annotations on every chart

๐ŸŽฏ XOR Decision Boundary

  • 2D heatmap that updates during training
  • Watch the network learn non-linear classification
  • Truth table comparison (target vs. predicted)

๐Ÿ“„ ArXiv-Style Research Papers

  • Neural Network Paper โ€” Full paper on the simulation platform with equations, figures, and references
  • Knight Chess AI Paper โ€” Analysis of chess AI with minimax, alpha-beta pruning, and complexity analysis

๐Ÿ› ๏ธ Tech Stack

Technology Purpose
React framework with SSR and routing
Type-safe development
Utility-first styling
Smooth animations and transitions
Training metrics visualization
Edge deployment and hosting

๐Ÿš€ Getting Started

Prerequisites

  • Node.js 18+
  • npm or yarn

Installation

# Clone the repository
git clone https://github.com/romizone/pytorch.git

# Navigate to the project
cd pytorch

# Install dependencies
npm install

# Start the development server
npm run dev

Open http://localhost:3000 in your browser.

Build for Production

npm run build
npm start

๐Ÿ“ Project Structure

pytorch/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ app/
โ”‚   โ”‚   โ”œโ”€โ”€ page.tsx                    # Main simulation page
โ”‚   โ”‚   โ”œโ”€โ”€ layout.tsx                  # Root layout
โ”‚   โ”‚   โ”œโ”€โ”€ globals.css                 # Global styles
โ”‚   โ”‚   โ””โ”€โ”€ paper/
โ”‚   โ”‚       โ”œโ”€โ”€ page.tsx                # Neural Network paper (ArXiv style)
โ”‚   โ”‚       โ””โ”€โ”€ knight-chess/
โ”‚   โ”‚           โ””โ”€โ”€ page.tsx            # Knight Chess AI paper (ArXiv style)
โ”‚   โ””โ”€โ”€ components/
โ”‚       โ”œโ”€โ”€ NeuralNetworkVisualizer.tsx  # Core network simulation
โ”‚       โ”œโ”€โ”€ TrainingChart.tsx            # Loss & accuracy charts
โ”‚       โ”œโ”€โ”€ PyTorchConcepts.tsx          # Interactive concept explorer
โ”‚       โ”œโ”€โ”€ XORPlayground.tsx            # XOR decision boundary
โ”‚       โ””โ”€โ”€ TrainingPipeline.tsx         # Training workflow guide
โ”œโ”€โ”€ package.json
โ”œโ”€โ”€ tsconfig.json
โ”œโ”€โ”€ tailwind.config.ts
โ””โ”€โ”€ next.config.ts

๐Ÿ“„ Research Papers

๐Ÿ“‘ Neural Network Simulation Paper

arXiv:2602.09847v1 [cs.LG] โ€” 14 Feb 2026

Full academic paper analyzing the simulation platform:

  • System architecture and component design
  • Neural network engine (forward prop, backprop, gradient descent)
  • 10 numbered equations, 3 figures, 3 tables
  • 10 academic references

๐Ÿ”— Read Paper โ†’

โ™ž Knight Chess AI Paper

arXiv:2602.10234v1 [cs.AI] โ€” 14 Feb 2026

Analysis of the Knight Chess game AI:

  • Game design: 8ร—9 board, 5 knights, 3,136 starting positions
  • AI engine: Minimax + Alpha-Beta pruning (3 difficulty levels)
  • Complexity analysis: branching factor ~42, game tree ~10ยนยณโฐ
  • 10 equations, 3 figures, 7 tables, 12 references

๐Ÿ”— Read Paper โ†’


๐Ÿงฎ Core Algorithms

Forward Propagation

z_j^(l) = ฮฃ w_ij ยท a_i^(l-1) + b_j^(l)
a_j^(l) = ฯƒ(z_j^(l))

Backpropagation

ฮด_out = (ลท - y) ยท ฯƒ'(z)
w โ† w - ฮท ยท ฮด ยท a_prev

Supported Activation Functions

Function Formula Best For
ReLU max(0, x) Hidden layers (fastest convergence)
Sigmoid 1/(1+eโปหฃ) Output layer (binary classification)
Tanh (eหฃ-eโปหฃ)/(eหฃ+eโปหฃ) Hidden layers (centered output)

๐Ÿค Contributing

Contributions are welcome! Here's how:

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

๐Ÿ“œ License

This project is open source and available under the MIT License.


๐Ÿ‘ค Author

Romin Urismanto
GitHub


โญ Star this repo if you found it helpful!

Made with love Powered by PyTorch

About

๐Ÿง  Interactive PyTorch Neural Network Simulation โ€” Learn deep learning through real-time visualization, live training, XOR playground, and auto-generated PyTorch code. Includes ArXiv-style research papers.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages