An object oriented neural network implementation.
Project description
Neural-pleX
An object oriented neural network implementation.
Installation
pip install neuralplex
Instructions
You can construct a neural network by specifying the Perceptrons for each layer and adding the Layers to the Network.
This Network's input Layer has 4 input Perceptrons and its output Layer has 1 output Perceptron. The hidden Layer has 8 Perceptrons.
l1 = Layer(perceptrons=[Perceptron(m=random()) for i in range(0, 4)], step=STEP)
l2 = Layer(perceptrons=[Perceptron(m=random()) for i in range(0, 8)], step=STEP)
l3 = Layer(perceptrons=[Perceptron(m=random())], step=STEP)
n1 = Network(
[
l1,
l2,
l3,
]
)
Test
The Test will train a model that estimates a decimal value given a binary nibble.
Install package.
pip install neuralplex
Clone the repository.
git clone https://github.com/faranalytics/neuralplex.git
Change directory into the repository.
cd neuralplex
Run the tests.
python -m unittest -v
Output
test_nibbles (tests.test.Test.test_nibbles) ... Training the model.
Training iteration: 0
Training iteration: 1000
Training iteration: 2000
Training iteration: 3000
Training iteration: 4000
Training iteration: 5000
Training iteration: 6000
Training iteration: 7000
Training iteration: 8000
Training iteration: 9000
1 input: [0, 0, 0, 1], truth: 1 prediction: [1.8160007977374275]
2 input: [0, 0, 1, 0], truth: 2 prediction: [2.768211299141504]
3 input: [0, 0, 1, 1], truth: 3 prediction: [4.584212096878932]
4 input: [0, 1, 0, 0], truth: 4 prediction: [3.772563194981495]
5 input: [0, 1, 0, 1], truth: 5 prediction: [5.588563992718923]
6 input: [0, 1, 1, 0], truth: 6 prediction: [6.540774494122998]
7 input: [0, 1, 1, 1], truth: 7 prediction: [8.356775291860426]
8 input: [1, 0, 0, 0], truth: 8 prediction: [6.784403350226391]
9 input: [1, 0, 0, 1], truth: 9 prediction: [8.600404147963818]
10 input: [1, 0, 1, 0], truth: 10 prediction: [9.552614649367897]
11 input: [1, 0, 1, 1], truth: 11 prediction: [11.368615447105324]
12 input: [1, 1, 0, 0], truth: 12 prediction: [10.556966545207885]
13 input: [1, 1, 0, 1], truth: 13 prediction: [12.372967342945314]
14 input: [1, 1, 1, 0], truth: 14 prediction: [13.32517784434939]
15 input: [1, 1, 1, 1], truth: 15 prediction: [15.141178642086818]
R2: 0.9599237139109126
ok
----------------------------------------------------------------------
Ran 1 test in 0.333s
OK
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
neuralplex-0.0.6.tar.gz
(5.4 kB
view details)
Built Distribution
File details
Details for the file neuralplex-0.0.6.tar.gz
.
File metadata
- Download URL: neuralplex-0.0.6.tar.gz
- Upload date:
- Size: 5.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 03cd39db1afe1410590c84920892e627a2558c56aaa74a17778749bbfa9c68b0 |
|
MD5 | dd8e29f8ece1b052f3166e8e7de4c00d |
|
BLAKE2b-256 | cccf9b885bc80679cb11a79d598e01d90672ba302c1f2605e65e901a28e1370c |
File details
Details for the file neuralplex-0.0.6-py3-none-any.whl
.
File metadata
- Download URL: neuralplex-0.0.6-py3-none-any.whl
- Upload date:
- Size: 4.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5045575ac3c4ec51726f76f644693c21a9312d38d4f6f8d8c5cb9708b65b9616 |
|
MD5 | 3325daed6dfeff03e5614cd7082ea8c0 |
|
BLAKE2b-256 | 61177021e13d41aba1768c194bfafa3d50019fb1dba09b763129ece09edc04b1 |