Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Neural Network from Scratch (NNFS) Backend

This project is a modular, lightweight deep learning framework written in Python using only NumPy. It contains custom implementations of dense layers, dropout, activation functions, optimizers, loss functions, and accuracy metrics.

Project Structure

  • layers/: Input, Dense, and Dropout layers.
  • activations/: ReLU, Softmax, Sigmoid, and Linear activations.
  • optimizers/: SGD, Adagrad, RMSprop, and Adam optimizers.
  • loss/: Categorical Crossentropy, Binary Crossentropy, MSE, and MAE loss functions.
  • accuracy/: Categorical and Regression accuracy calculations.
  • model.py: The Model class coordinating the forward pass, backward pass, and training loop.
  • main.py: Example script training a model on a tiny custom 2D classification dataset.
  • test_model.py: Test suite validating model training on a tiny XOR dataset.
  • test_sklearn.py: Test script validating training on the sklearn Iris dataset.

Usage

Running the Example

To train a model on the tiny custom dataset:

python3 main.py

Running the Sklearn Iris Test

To train and evaluate a model on the Iris dataset from scikit-learn:

python3 test_sklearn.py

Running the XOR Tests

To run the XOR training test:

python3 test_model.py

About

a ml library from scratch

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages