Feed Forward Neural Networks
Project description
Installation
$ [sudo] pip install feedforwardnet-shine7
Usage
from Neural_Network import NeuralNetwork
# Create a Neural Network
inputs = 2
output_neurons = 1
hidden_layers = 2
each_hidden_nodes = [2, 3]
network = NeuralNetwork(inputs, hidden_layers, output_neurons, each_hidden_nodes)
Building a dataset
Dataset must be python list of data_samples, where each data_sample is a list of input and target.
For Eg: Input: [1, 1], Target: [1] => [[1, 1], [1]] is a data sample.
A typical XOR function's dataset looks something like :
>>> XOR_data =
[
[ ### ####
[0, 0], # Input Data
[0] # Output Sample
], ### ####
[
[0, 1],
[1]
],
[
[1, 0],
[1]
],
[
[1, 1],
[0]
]
]
>>> size = 4 # Length of the data
Training The network
The library provides a Train function which accepts the dataset, dataset size, and two optional parameters MAX_EPOCHS and Graph.
def Train(dataset, size, MAX_EPOCHS=10000, graph=False) :
....
....
For Eg: If you want to train your network for 5000 epochs and display epoch vs error graph after training.
>>> network.Train(XOR_data, size, MAX_EPOCHS=5000, graph=True)
Debugging
If you want to look at the network's weights at any point of time, the library provides a print_weights function.
>>> network.print_weights()
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
Built Distribution
Close
Hashes for feedforwardnet-shine7-0.0.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 06e3253fc7852456e1e3e47f49eb23f9172bf8d7ded196181527670613942551 |
|
MD5 | 74003613ab75631e33b11bb4f445bbb5 |
|
BLAKE2b-256 | ed702fd65d715caec5b20900641feeb9853bd9503be3452762b25d800aaf242d |
Close
Hashes for feedforwardnet_shine7-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ff980f83c8d2bcee4956cd7f38a98b168d801d458091baea34d6d5303de3c843 |
|
MD5 | 58aa48cf732dc991fe723f77e422b336 |
|
BLAKE2b-256 | 9c59a7d44f8eebd66970b4e4c00a538232d6df98dc671da3c03f778997bfab25 |