Convolution Layers

class npdl.layers.Convolution(nb_filter, filter_size, input_shape=None, stride=1, init='glorot_uniform', activation='relu')[source][source]

Convolution operator for filtering windows of two-dimensional inputs.

When using this layer as the first layer in a model, provide the keyword argument input_shape (tuple of integers, does not include the sample axis), e.g. input_shape=(3, 128, 128) for 128x128 RGB pictures.

backward(pre_grad, *args, **kwargs)[source][source]

calculate the input gradient

connect_to(prev_layer=None)[source][source]

Propagates the given input through this layer (and only this layer).

Parameters:
prev_layer : previous layer

The previous layer to propagate through this layer.

forward(input, *args, **kwargs)[source][source]

Calculate layer output for given input (forward propagation).

grads[source]

Get layer parameter gradients as calculated from backward().

params[source]

Layer parameters.

Returns a list of numpy.array variables or expressions that parameterize the layer.

Returns:
list of numpy.array variables or expressions

A list of variables that parameterize the layer

Notes

For layers without any parameters, this will return an empty list.