Metadata-Version: 2.4
Name: LearnNeuralNet
Version: 0.1.0
Summary: A from-scratch neural network library built with NumPy for learning how neural networks work under the hood.
Author: Justin Ortega
License: MIT
Project-URL: Homepage, https://github.com/Jort12/LearnNeuralNet
Project-URL: Repository, https://github.com/Jort12/LearnNeuralNet
Project-URL: Issues, https://github.com/Jort12/LearnNeuralNet/issues
Keywords: neural network,machine learning,deep learning,numpy,education
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Education
Classifier: Intended Audience :: Developers
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy
Dynamic: license-file

# nn — Neural Network Library from Scratch

A lightweight neural network library built entirely with NumPy. No TensorFlow, no PyTorch — just pure Python and linear algebra.

## Purpose

This project was built to help beginners understand the core components of neural networks and how they function under the hood.

While frameworks like TensorFlow and PyTorch provide powerful abstractions, they often hide important implementation details. This library exposes those details while still offering a simple, Keras-style API for building and training models.

The goal is to prepare users to confidently transition into using industry-standard ML libraries by giving them a strong foundation in how neural networks are constructed and trained.

This project also served as a personal learning exercise for the author — specifically in designing clean, extensible interfaces, improving object-oriented programming skills, and structuring a Python package with a modular file architecture. Claude was used throughout the process as a design partner for planning the interface, organizing the file structure, and working through OOP patterns to support future additions to the library.

## Quick Start

```python
from nn import Sequential, Dense

# Define the model
model = Sequential()
model.add(Dense(64, activation='relu'))
model.add(Dense(32, activation='relu'))
model.add(Dense(1, activation='sigmoid'))

# Configure training
model.compile(loss='bce', lr=0.01, momentum=0.9)

# Train
history = model.fit(X_train, y_train, epochs=100, batch_size=32)

# Predict
predictions = model.predict(X_test)

# Save and load
model.save('my_model.npz')
loaded_model = Sequential.load('my_model.npz')
```

## Project Structure

```
nn/
├── __init__.py              # Public API — exports Sequential, Dense
├── sequential.py            # Model orchestrator — add, compile, fit, predict, save, load
├── layers/
│   ├── __init__.py
│   ├── base.py              # Layer base class — contract for all layers
│   └── dense.py             # Dense (fully connected) layer
├── activations/
│   ├── __init__.py
│   └── functions.py         # ReLU, Sigmoid, Linear + string registry
├── losses/
│   ├── __init__.py
│   └── functions.py         # MSE, BCE + string registry
├── optimizers/
│   ├── __init__.py
│   ├── base.py              # Optimizer base class
│   └── sgd.py               # SGD with optional momentum
└── utils/
    ├── __init__.py
    └── initializers.py      # Xavier, He, and zero initialization
```

## Current Capabilities

**Layers**
- Dense (fully connected)

**Activations**
- ReLU
- Sigmoid
- Linear

**Loss Functions**
- Mean Squared Error (MSE)
- Binary Cross-Entropy (BCE)

**Optimization**
- Stochastic Gradient Descent (SGD) with optional momentum

**Utilities**
- Save and load trained models
- Model summary
- Training history tracking
- Mini-batch and full-batch training
- Xavier and He weight initialization

## Planned Features

- Categorical Cross-Entropy (CCE) loss
- Softmax activation
- Tanh activation
- Adam optimizer
- Dropout layer

## Requirements

- Python 3.8+
- NumPy
