Skip to main content

GliaML - Python Machine Learning Library

Project description

# 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.

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

gliaml-0.1.1.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gliaml-0.1.1-py3-none-any.whl (14.3 kB view details)

Uploaded Python 3

File details

Details for the file gliaml-0.1.1.tar.gz.

File metadata

  • Download URL: gliaml-0.1.1.tar.gz
  • Upload date:
  • Size: 8.9 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for gliaml-0.1.1.tar.gz
Algorithm Hash digest
SHA256 08baf41c63529575e579361dc25deab3386f73b3874ead4391a86f6ad3e57d7b
MD5 ab8e81e960dc7f6518a80aad49fcbca8
BLAKE2b-256 e91affa469d9cd292652fac1c420c227914e14f4dfd4b03c2a31366608c08063

See more details on using hashes here.

File details

Details for the file gliaml-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: gliaml-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 14.3 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for gliaml-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 12581378affa28b4966f8e07fab5f1cb19e689c33fbb50e25b7ee2e9eb42b94a
MD5 4962f8a1603aea2991240cc93b886783
BLAKE2b-256 877c250032b26ca764b619045644e315f69026500df88f6cd0650368e2040a44

See more details on using hashes here.

Supported by

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