Skip to main content

# GliaML

GliaML is simple, yet powerful machine learning library written in Python.

Currently, it allows a user to easily create a multi-layer perceptron neural network with the following features:

  1. Allow backpropagation with the sigmoid, tanh, and ReLU activation functions.

  2. Allow normalisation of a classifier with the softmax function.

  3. Allow learning rate hyperparameter functionality (including biases)

  4. Allow L2 regularisation to prevent over-fitting

## Creating a Network

In GliaML, neural networks are implemented as objects containing a collection of layers, which are in turn objects. To create a layer, first a list of activation functions for each neuron in the list must be chosen. Then the layer can be created. Bias functionality can be

activations1 = [activation_id for i in range(0, num_neurons)] layer1 = NetworkLayer(num_inputs, num_neurons, activations1, bias=False)

After a satisfactory number of layers have been created, the neural network itself can be invoked by calling the constructor and providing all the layers. If

network = NeuralNetwork(l2_regularization=0.03, layer1, layer2, …)

## Training a network

After creating your network, you’ll want to provide training and testing data. These should be formatted as NumPy arrays. For example, let us consider the following training set.

training_inputs = np.array([[1, 0, 1], [0, 0, 1], [1, 1, 0], [0, 1, 0]]) training_outputs = np.array([[1, 1, 0, 0]]).T

The solution is whether or not there is a 1 or 0 in the 3rd place of the input array. We now need to train the network. We can either use mean-squared error or cross-entropy loss.

network.train_mean_squared_error(training_inputs, training_outputs, num_iterations,

learning_rate=0.05, bias_learning_rate=0.05)

We can now see the network’s response on a problem it hasn’t seen before.

answer = network.think(np.array([1, 1, 1])) print(answer[-1])

See [example.py](https://github.com/Archiecool4/GliaML/blob/master/example.py) for another usage example.

Release files for gliaml 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gliaml 0.1.1
File Size Uploaded
gliaml-0.1.1.tar.gz 8.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gliaml 0.1.1
File Interpreter ABI Platform
gliaml-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 23.2 kB

Release files / gliaml-0.1.1.tar.gz

Download URL gliaml-0.1.1.tar.gz
Size 8.9 kB
Tags Source
SHA-256 checksum
How to use checksums
08baf41c63529575e579361dc25deab3386f73b3874ead4391a86f6ad3e57d7b
BLAKE2b-256 checksum
How to use checksums
e91affa469d9cd292652fac1c420c227914e14f4dfd4b03c2a31366608c08063
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.7.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.8

Release files / gliaml-0.1.1-py3-none-any.whl

Download URL gliaml-0.1.1-py3-none-any.whl
Size 14.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
12581378affa28b4966f8e07fab5f1cb19e689c33fbb50e25b7ee2e9eb42b94a
BLAKE2b-256 checksum
How to use checksums
877c250032b26ca764b619045644e315f69026500df88f6cd0650368e2040a44
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.7.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.8

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page