Skip to main content

No project description provided

Project description

Madrin

Neural_Network
A cute Neural Network library with Keras-like API with just 100 lines of code. Build for fun and educational purposes. Because the code is so simple, it is very easy to change to your needs. Still under active development.

Dependencies

Demo

Create a neural network:
You can create a Neural Network by passing a list of layers to the Network constructor.
Currently it supports the following layers:

Linear(no_of_neurons, input_size)
Relu()
Sigmoid()
Tanh()
Softmax()

import madrin as mad

model = Network([ mad.Linear(50,1), mad.Relu(),
                  mad.Linear(50, 50), mad.Relu(),
                  mad.Linear(50, 50), mad.Relu(),
                  mad.Linear(1,50), mad.Sigmoid() ])

Training

model.fit(inputs, labels, learning_rate, epochs, loss='mse') 

Evaluate

model.costs(inputs, labels)

Predictions

model.forward(inputs)

Visualize the learning

import numpy as np
import matplotlib.pyplot as plt
plt.plot(np.arange(len(model.costs)),model.costs)
plt.xlabel("Iteration")
plt.ylabel("Loss")
plt.show()

loss
Visualize the predictions(if possible)

plt.scatter(inputs, labels)
plt.plot(inputs, model.forward(inputs))
plt.show()

predictions

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

madrin-0.0.1-py3-none-any.whl (4.0 kB view hashes)

Uploaded Python 3

Supported by

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