Skip to main content

Feed Forward Neural Networks

Project description

Feed Forward Neural Networks using NumPy

This library is a modification of my previous one. Click Here to check my previous library.

Installation

$ [sudo] pip3 install neuralnetworks-shine7

Development Installation

$ git clone https://github.com/Subhash3/Neural_Net_Using_NumPy.git

Usage

>>> from Model import NeuralNetwork

Create a Neural Network

inputs = 2
outputs = 1
network = NeuralNetwork(inputs, outputs)

# Add 2 hidden layers with 16 neurons each and activation function 'tanh'
network.addLayer(16, activation_function="tanh") 
network.addLayer(16, activation_function="tanh")

# Finish the neural network by adding the output layer with sigmoid activation function.
network.compile(activation_function="sigmoid")

Building a dataset

The package contains a Dataset class to create a dataset.

>>> from Dataset import Dataset

Make sure you have inputs and target values in seperate files in csv format.

input_file = "inputs.csv"
target_file = "targets.csv"

# Create a dataset object with the same inputs and outputs defined for the network.
datasetCreator = Dataset(inputs, outputs)
datasetCreator.makeDataset(input_file, target_file)
data, size = datasetCreator.getRawData()

Training The network

The library provides a Train function which accepts the dataset, dataset size, and two optional parameters epochs, and logging.

def Train(dataset, size, epochs=5000, logging=True) :
	....
	....

For Eg: If you want to train your network for 1000 epochs.

>>> network.Train(data, size, epochs=1000, graph=True)

Notice that I didn't change the value of log_outputs as I want the output to printed for each epoch.

Debugging

Plot a nice epoch vs error graph

>>> network.epoch_vs_error()

Know how well the model performed.

>>> network.evaluate()

Project details


Download files

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

Source Distribution

neuralnetworks-shine7-0.0.3.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

neuralnetworks_shine7-0.0.3-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file neuralnetworks-shine7-0.0.3.tar.gz.

File metadata

  • Download URL: neuralnetworks-shine7-0.0.3.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.6.9

File hashes

Hashes for neuralnetworks-shine7-0.0.3.tar.gz
Algorithm Hash digest
SHA256 34bb93aa23052b3814f080184c42f55340a19c570d8dc0a36af09627c4afaaa5
MD5 1a115f29fa35bc64cfaf4703efa3f378
BLAKE2b-256 b5d96b6511bb2f13ddc506fdc9e75428d56fae712ef9741c2667cc884cf8bcca

See more details on using hashes here.

File details

Details for the file neuralnetworks_shine7-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: neuralnetworks_shine7-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 7.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.6.9

File hashes

Hashes for neuralnetworks_shine7-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 263ab893463b6afebda927ad2908ef0a532687a4dd2e63ae95f6f781074e6d83
MD5 98af191900a198cbd8129ab1d6b2af7e
BLAKE2b-256 1ae4ae478a894d0418aec048a523c7b88cb5ff74774da03f0bc55ff3fff9b733

See more details on using hashes here.

Supported by

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