Thanks to visit codestin.com
Credit goes to github.com

Skip to content

KilianZimmerer/MNIST_NN

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple Neural Network from Scratch

This is a simple implementation of a neural network from scratch.

Description

This project is a basic, feedforward neural network built using only NumPy and Pandas.

The network is designed for classification tasks, such as recognizing handwritten digits from the MNIST dataset (input size 784 for 28x28 images, output size 10 for digits 0-9).

Quick Start 🚀

Follow these steps to set up the environment and run script:

1. Setup Environment

Install the project dependencies from pyproject.toml and activate the virtual environment.

uv sync
source .venv/bin/activate

2. Run Script

python NN.py

How to Use 🛠️

  1. Initialize the Network:

    # nn.py
    nn = NeuralNetwork(input_layer_size=784, hidden_layer_sizes=(16, 16), output_layer_size=10)
  2. Load Data:

    # Make sure 'train.csv' is in the same directory
    nn.get_training_data('train.csv')
  3. Perform a Forward Pass:

    # Get the network's output for the 20th sample in the dataset
    predicted_output, actual_output = nn.forward_propagation(20)
    print("Predicted Output:", predicted_output)

TODOs

  • Implement the backpropagation algorithm to calculate gradients for weights and biases.
  • Complete the training method to iterate over the dataset and update weights.
  • Implement the prediction method for making predictions on new data.

About

A neural network approach to classify handwritten numbers from 0 to 9. Implemented from scratch.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages