NeuralNet
Table of Contents
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:
Metadata
Release files for NNeuralNet 1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| NNeuralNet-1.0.tar.gz | 9.9 kB | Without provenance | Details for NNeuralNet-1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| NNeuralNet-1.0-py3-none-any.whl | Python 3 | none | any | Details for NNeuralNet-1.0-py3-none-any.whl |
Total release size: 18.2 kB
Release files / NNeuralNet-1.0.tar.gz
| Download URL | NNeuralNet-1.0.tar.gz |
|---|---|
| Size | 9.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
02657fd8d393888c5fe81b7a3146a50237636d4916e446e7dce65a4cf4002f87
|
|
BLAKE2b-256 checksum How to use checksums |
1296763e783994b2cf722c28c63ba9c0e43cc2951bd846b2852cf8b006caecee
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Release files / NNeuralNet-1.0-py3-none-any.whl
| Download URL | NNeuralNet-1.0-py3-none-any.whl |
|---|---|
| Size | 8.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5b17f82dd067672524e0d57bc9b02d6b7f8b811018b851c5b4bea170a7c66b29
|
|
BLAKE2b-256 checksum How to use checksums |
3dc5c06a87b581b796fe8fb2dd6cc368faa1597c9e25fec8d295dee15a3fd760
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Security for NNeuralNet 1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.