Neural networks

class untwist.neuralnetworks.Layer(input, n_in, n_out, W=None, b=None, activation=<theano.tensor.elemwise.Elemwise object>)[source]

Generic feed-forward layer (can be hidden or output)

class untwist.neuralnetworks.Activations[source]

Some activation functions not available in theano.

classmethod ReLU()[source]
classmethod ReLU2()[source]
class untwist.neuralnetworks.MLP(input_size, output_size, hidden_sizes, activation=<theano.tensor.elemwise.Elemwise object>)[source]

Multi-Layer Perceptron network, specified by the size of the input, the output and an arbitrary number of hidden layers.

load(fname)[source]
save(fname)[source]
class untwist.neuralnetworks.SGD(mlp, learning_rate=0.1, momentum=0.5, batch_size=100, iterations=100, patience=0, rate_decay_th=0.1)[source]

Stochastic gradient descent algorithm for training MLP instances Includes momentum, learning rate scheduling, early stopping.

predict(data)[source]

Get mlp prediction from observation.

train(dataset)[source]

Train the MLP passed to the constructor using a Dataset.