NeuralPaper.ai is a platform that integrates Neural DSL with NeuralDbg to create interactive, annotated neural network models with visualization features similar to nn.labml.ai. It provides a web-based interface for creating, visualizing, and sharing neural network models with detailed explanations and interactive elements.
- Annotated Models: Explore neural network architectures with detailed annotations explaining each component
- Interactive Visualization: Visualize model architecture, shape propagation, and computation flow in real-time
- Live Debugging: Debug models with NeuralDbg to analyze gradients, activations, and performance
- DSL Playground: Experiment with Neural DSL to create and modify models with instant feedback
- Educational Resources: Learn about neural network concepts with interactive examples and tutorials
neuralpaper/
├── backend/
│ ├── api/ # FastAPI server for Neural DSL execution
│ ├── models/ # Annotated model implementations
│ └── integrations/ # Connectors to Neural and NeuralDbg
├── frontend/
│ ├── components/ # React components
│ │ ├── ModelViewer/ # Interactive model visualization
│ │ ├── CodeAnnotation/ # Side-by-side code and annotations
│ │ ├── DSLPlayground/ # Interactive DSL editor
│ │ └── DebugPanel/ # NeuralDbg integration
│ ├── pages/ # Next.js pages
│ │ ├── models/ # Model showcase pages
│ │ ├── playground/ # DSL playground page
│ │ └── blog/ # Blog section
│ └── public/ # Static assets
└── shared/ # Shared types and utilities
- Node.js 14+ and npm
- Python 3.8+
- Neural DSL and NeuralDbg installed
-
Clone the repository:
git clone https://github.com/yourusername/neuralpaper.git cd neuralpaper -
Install backend dependencies:
cd backend pip install -r requirements.txt -
Install frontend dependencies:
cd ../frontend npm install
-
Initialize the database with sample models:
cd backend/scripts python init_db.py -
Start the backend server:
cd backend uvicorn api.main:app --reload -
Start the frontend development server:
cd frontend npm run dev -
Open your browser and navigate to
http://localhost:3000
Alternatively, you can use the provided start.sh script to start both the backend and frontend servers:
cd neuralpaper
./start.shTo add a new annotated model:
- Create a Neural DSL file in
backend/models/(e.g.,mymodel.neural) - Create an annotations file in
backend/models/(e.g.,mymodel.annotations.json) with the following structure:{ "name": "My Model", "description": "Description of my model", "category": "Computer Vision", "complexity": "Medium", "sections": [ { "id": "section1", "lineStart": 1, "lineEnd": 5, "annotation": "Explanation of this section" } ] } - The model will be automatically available in the frontend
The current implementation includes some mock data and placeholders. To make it fully real:
-
Complete the WebSocket Integration:
- Enhance the WebSocket endpoints in
backend/api/main.pyto stream real data from NeuralDbg - Update the
neural_connector.pyto capture and forward NeuralDbg output
- Enhance the WebSocket endpoints in
-
Implement Real-Time Debugging:
- Add methods to query the running NeuralDbg instance for real-time data
- Replace the mock trace data with real data from your running NeuralDbg instance
-
Add Database Integration:
- Replace the file-based storage with a proper database (SQLite, PostgreSQL, etc.)
- Implement proper model management with CRUD operations
-
Enhance the Frontend:
- Add more interactive visualizations
- Implement user authentication
- Add a blog section for tutorials and articles
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
- Neural DSL - The domain-specific language for neural networks
- NeuralDbg - The neural network debugger
- nn.labml.ai - Inspiration for the annotated model format
