Skip to content

A neural network library based on tensorflow and with true sklearn compatibility.

Notifications You must be signed in to change notification settings

BenjaminBossan/mink

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

83 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mink

A neural network library based on tensorflow and with true sklearn compatibility.

Goal

In short, the goal is: Lasagne + nolearn - theano + tensorflow = mink

State

This is in very early stage of development. Help with development is welcome.

Example

For more elaborate use cases, see notebooks here (CNN), here (RNN), here (grid search), and here (validation scores).

from sklearn.datasets import make_classification
from mink import NeuralNetClassifier
from mink import layers

# Get classification data
X, y = make_classification(n_samples=2000, n_classes=5, n_informative=10)

# Define network architecture: no need to set shape of incoming data, 
# number of classes, softmax nonlinearity or anything.

l = layers.InputLayer()
l = layers.DenseLayer(l, name='hidden', num_units=50)
l = layers.DenseLayer(l)

net = NeuralNetClassifier(layer=l)

# It is possible to set the hyperparameters such as the learning 
# rate after initializing the net. If a layer has a name ("hidden"), 
# that name can be used to reference the layer. This allows to easily 
# use GridSearchCV etc.

net.set_params(hidden__num_units=100)
net.set_params(update__learning_rate=0.05)

# Fit the net
net.fit(X, y)

# Make predictions
y_pred = net.predict(X)

About

A neural network library based on tensorflow and with true sklearn compatibility.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published