API reference, deeppy.feedforward

Neural network

class deeppy.feedforward.neural_network.NeuralNetwork(layers, loss)[source]

Bases: deeppy.base.Model, deeppy.base.PhaseMixin

fprop(x)[source]
phase
predict(input)[source]

Calculate the output for the given input x.

y_shape(x_shape)[source]

Layers

class deeppy.feedforward.layers.Activation(method)[source]

Bases: deeppy.feedforward.layers.Layer

bprop(y_grad)[source]
fprop(x)[source]
y_shape(x_shape)[source]
class deeppy.feedforward.layers.FullyConnected(n_out, weights, bias=0.0)[source]

Bases: deeppy.feedforward.layers.Layer, deeppy.base.ParamMixin

bprop(y_grad)[source]
fprop(x)[source]
y_shape(x_shape)[source]
class deeppy.feedforward.layers.Layer[source]

Bases: deeppy.base.PickleMixin

bprop(y_grad)[source]

Calculate input gradient.

bprop_to_x = True
fprop(x)[source]

Calculate layer output for given input (forward propagation).

y_shape(x_shape)[source]

Calculate shape of this layer’s output. x_shape[0] is the number of samples in the input. x_shape[1:] is the shape of the feature.

class deeppy.feedforward.layers.PReLU(a=0.25)[source]

Bases: deeppy.feedforward.layers.Layer, deeppy.base.ParamMixin

bprop(y_grad)[source]
fprop(x)[source]
y_shape(x_shape)[source]

Convnet layers

class deeppy.feedforward.convnet_layers.Convolution(n_filters, filter_shape, weights, bias=0.0, strides=(1, 1), border_mode='valid')[source]

Bases: deeppy.feedforward.layers.Layer, deeppy.base.ParamMixin

bprop(y_grad)[source]
fprop(x)[source]
y_shape(x_shape)[source]
class deeppy.feedforward.convnet_layers.Flatten[source]

Bases: deeppy.feedforward.layers.Layer

bprop(y_grad)[source]
fprop(x)[source]
y_shape(x_shape)[source]
class deeppy.feedforward.convnet_layers.LocalContrastNormalization(kernel, eps=0.1, strides=(1, 1))[source]

Bases: deeppy.feedforward.layers.Layer

bprop(y_grad)[source]
fprop(x)[source]
static gaussian_kernel(sigma, size=None)[source]
y_shape(x_shape)[source]
class deeppy.feedforward.convnet_layers.LocalResponseNormalization(alpha=0.0001, beta=0.75, n=5, k=1)[source]

Bases: deeppy.feedforward.layers.Layer

bprop(y_grad)[source]
fprop(x)[source]
y_shape(x_shape)[source]
class deeppy.feedforward.convnet_layers.Pool(win_shape=(3, 3), method='max', strides=(1, 1), border_mode='valid')[source]

Bases: deeppy.feedforward.layers.Layer

bprop(y_grad)[source]
fprop(x)[source]
y_shape(x_shape)[source]
deeppy.feedforward.convnet_layers.padding(win_shape, border_mode)[source]

Dropout layers

class deeppy.feedforward.dropout_layers.Dropout(dropout=0.5)[source]

Bases: deeppy.feedforward.layers.Layer, deeppy.base.PhaseMixin

bprop(y_grad)[source]
fprop(x)[source]
y_shape(x_shape)[source]
class deeppy.feedforward.dropout_layers.DropoutFullyConnected(n_out, weights, bias=0.0, dropout=0.5)[source]

Bases: deeppy.feedforward.layers.FullyConnected, deeppy.base.PhaseMixin

bprop(y_grad)[source]
fprop(x)[source]

Losses