vanillanets

About

Understand the philosophy, capabilities, and primary use cases of the VanillaNets framework.

VanillaNets is a pure-Python, NumPy-backed neural network framework. It is engineered specifically to make the mathematical and algorithmic mechanics of deep learning fully transparent and inspectable. By stripping away heavy framework abstractions, VanillaNets gives you direct access to the mathematical realities of neural networks.

Core Philosophy

The library is built on the belief that true understanding requires complete transparency. The framework's design prioritizes explicit computation and readability over automated convenience.

  • Transparency over Abstraction: There are no hidden computational graphs, auto-grad engines, or black-box operations. You can step through every matrix multiplication and gradient calculation.
  • Hackable by Design: Because the source code acts as the ultimate source of truth, you can freely modify any layer, activation, or optimizer without fighting rigid framework constraints.
  • Zero-Bloat Dependencies: The core library relies exclusively on pure Python and NumPy, ensuring a lightweight, stable, and highly portable environment.

Framework Capabilities

It provides a comprehensive suite of building blocks to construct, train, and evaluate deep learning models from the ground up:

  • Network Architecture: Construct flexible dense networks with advanced weight initialization strategies (He, Xavier, Normal, Uniform) to ensure optimal convergence.
  • Non-linear Dynamics: Control network behavior using a full library of activation functions (Linear, ReLU, LeakyReLU, Tanh, Sigmoid, Softmax), each featuring explicitly implemented forward and backward passes.
  • Targeted Loss Functions: Optimize models for diverse tasks using Binary Cross-Entropy, Categorical Cross-Entropy, Sparse Categorical Cross-Entropy, or Mean Squared Error.
  • Robust Optimization: Drive gradient descent efficiently using standard SGD (with momentum and decay) or the highly adaptive Adam optimizer.
  • Comprehensive Evaluation: Measure success precisely using built-in metrics for both classification (Accuracy, Precision, Recall, F1 Score, Confusion Matrix) and regression (R², MAE, RMSE).

The Modeling Workflow

The API is intentionally designed to mirror industry-standard sequential modeling. This ensures an intuitive developer experience while allowing your conceptual knowledge to transfer seamlessly to larger frameworks later:

  1. Initialize: Create a base Model instance.
  2. Stack: Define your architecture by adding dense layers and activations sequentially using model.add().
  3. Compile: Attach your loss function, optimizer, and chosen evaluation metrics using model.set().
  4. Lock & Train: Prepare the computational graph with model.finalize(), then train your network using model.fit().
  5. Evaluate & Deploy: Assess real-world performance with model.evaluate() and generate predictions via model.predict().

Ideal Use Cases

VanillaNets is purposely positioned for scenarios where inspecting the "how" and "why" is just as important as the final output:

  • Educational Sandboxes: An ideal foundation for instructors, students, and curriculum developers who want to dissect backpropagation and gradient descent without external magic.
  • Algorithmic Prototyping: A lightweight workbench for ML researchers testing novel custom activation functions, custom loss landscapes, or experimental optimization heuristics.
  • Engineering Interviews: A perfect study tool for machine learning engineers practicing and internalizing from-scratch algorithm implementations.

Next Steps

On this page