No project description provided
Project description
Madrin
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()
Visualize the predictions(if possible)
plt.scatter(inputs, labels)
plt.plot(inputs, model.forward(inputs))
plt.show()
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 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)