Another Unnecessary Neural Network Library
Project description
AUNNL is another unnecessary neural network library for Python 3.x. It is intended to help create and train basic neural networks very easily.
Getting Started
Installation
It is recommended you install via pip for Python 3:
pip install aunnl
After this, you can import it into your python program with:
import aunnl
Basic Example
The following example trains a neural network to classify handwritten digits from the MNIST dataset. The dataset is loaded using the mnist_web
module, which is not packaged with AUNNL. Download and install it with the command pip install mnist_web
.
import aunnl
from mnist_web import mnist
data, labels, _, _ = mnist(path="dataset")
model = aunnl.NeuralNetwork([784, 256, 10], ["relu", "sigmoid"])
epochs, lr, batch_size = 1, 0.1, 64
model.fit(data, labels, epochs, batch_size, lr, aunnl.losses.MSE)
model.save("mnist.aunn")
In the above example, a neural network with a hidden layer of 256 neurons is trained - its activation being ReLU and the output layer activation being sigmoid. The model, which is an aunnl.NeuralNetwork
object, is then saved to the file mnist.aunn
. The model can be loaded from the file with aunnl.loadModel('mnist.aunn')
.
To use the model, simply pass the image in the form of a flat numpy array (denoted here as img_arr
) to the model with model.feedForward(img_arr)
. The feedForward
function returns a list of the values outputted by the model.
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
Built Distribution
File details
Details for the file aunnl-3.0.3.tar.gz
.
File metadata
- Download URL: aunnl-3.0.3.tar.gz
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.11.1 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cc834df18f748100c25ef8c116c177d0629049c115b4df28d6546ff88c2c68be |
|
MD5 | e9c74878babc6c812e543537eae1a960 |
|
BLAKE2b-256 | 3096aa936df29346dda3106de77d37298906ae632d8c0e3b065e021b30af839b |
File details
Details for the file aunnl-3.0.3-py3-none-any.whl
.
File metadata
- Download URL: aunnl-3.0.3-py3-none-any.whl
- Upload date:
- Size: 5.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.11.1 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8b959ea2fec99414dbf01aa92111c8cd705b55edbe84ce5a15a9fbddecd9d274 |
|
MD5 | 8ab0e6f0c01e96c98421d5926d861763 |
|
BLAKE2b-256 | 051e51dfcd938cd3565a23d448d5f9cedcc7b5f37cb85261814183c7627f51c6 |