Skip to main content

Implementation of a Feed Forward Neural Network

Project description

NeuralNet

Table of Contents

  1. Introduction
  2. Download
  3. Quick Start
  4. Features
  5. Project Report

Introduction

This repository contains an implementation of a Feed Forward Neural Network from scratch using numpy libraries. We have achieved a testing accuracy of 97.45% on MNIST Dataset and a 88.80.% testing accuracy on Fashion-MNIST Dataset.

You can also find a GPU version of the class NeuralNet in ctrain.py (Uses cupy instead of numpy(CuDa compatible)). We have found about 50~100 x speed boost in training time. We will release the cupy version module soon.

Download

You can view the source code for the NeuralNet class implementation from this page.

pip install NNeuralNet

Quick Start

Training

from NNeuralNet.NeuralNet import NeuralNet
from keras.datasets import mnist

# Import and Preprocess Data
( X_train, Y_train), ( X_test, Y_test) = mnist.load_data()
X_train = X_train.reshape(X_train.shape[0],-1).T
X_test = X_test.reshape(X_test.shape[0],-1).T

nn = NeuralNet( input_size = 784, output_size = 10)
nn.addlayer(128)
nn.addlayer(64)
nn.train( X_train, Y_train, numepochs = 10, learning_rate = 0.001)

Prediction

nn.predict( X_test, returnclass = 1)
# Set returnclass = 0 for class probabilities

Saving a Model

nn.save_model( "my_model.bin")

Loading a Saved Model

nn = NeuralNet.load_model( "my_model.bin")

Features

The NeuralNet class has support for the following features/parameters support:

Project details


Release history Release notifications | RSS feed

This version

1.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

NNeuralNet-1.0.tar.gz (9.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

NNeuralNet-1.0-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

Details for the file NNeuralNet-1.0.tar.gz.

File metadata

  • Download URL: NNeuralNet-1.0.tar.gz
  • Upload date:
  • Size: 9.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.5

File hashes

Hashes for NNeuralNet-1.0.tar.gz
Algorithm Hash digest
SHA256 02657fd8d393888c5fe81b7a3146a50237636d4916e446e7dce65a4cf4002f87
MD5 9b0232b5a72db03ba6da7c1fa211aae6
BLAKE2b-256 1296763e783994b2cf722c28c63ba9c0e43cc2951bd846b2852cf8b006caecee

See more details on using hashes here.

File details

Details for the file NNeuralNet-1.0-py3-none-any.whl.

File metadata

  • Download URL: NNeuralNet-1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.5

File hashes

Hashes for NNeuralNet-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5b17f82dd067672524e0d57bc9b02d6b7f8b811018b851c5b4bea170a7c66b29
MD5 6d8ab34bddf46ac19fa90f3a46c3e938
BLAKE2b-256 3dc5c06a87b581b796fe8fb2dd6cc368faa1597c9e25fec8d295dee15a3fd760

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page