class SpatialConvolution

Class for doing convolution over images.

Inheritance:


Public Fields

[more]int k_w
Kernel size (height and width)
[more]int d_x
'x' translation in the input image after each application of the kernel
[more]int d_y
'y' translation in the input image after each application of the kernel
[more]int n_input_planes
Number of input images
[more]int n_output_planes
Number of output images
[more]int input_height
Height of each input image
[more]int input_width
Width of each input image
[more]int output_height
Height of each output image
[more]int output_width
Width of each output image
[more]real** weights
weights[i] means kernel-weights for output plane i.
[more]real** der_weights
Derivatives associated to weights
[more]real* biases
biases[i] is the bias for output plane i
[more]real* der_biases
Derivatives associated to biases

Public Methods

[more] SpatialConvolution(int n_input_planes_, int n_output_planes_, int width_, int height_, int k_w_=5, int d_x_=1, int d_y_=1)
Create a convolution layer


Inherited from GradientMachine:

Public Fields

oint n_inputs
oint n_outputs
oParameters* params
oParameters* der_params
oSequence* beta

Public Methods

ovirtual void iterInitialize()
ovirtual void forward(Sequence* inputs)
ovirtual void backward(Sequence* inputs, Sequence* alpha)
ovirtual void setPartialBackprop(bool flag=true)
ovirtual void frameForward(int t, real* f_inputs, real* f_outputs)
ovirtual void frameBackward(int t, real* f_inputs, real* beta_, real* f_outputs, real* alpha_)
ovirtual void loadXFile(XFile* file)
ovirtual void saveXFile(XFile* file)


Inherited from Machine:

Public Fields

oSequence* outputs

Public Methods

ovirtual void reset()
ovirtual void setDataSet(DataSet* dataset_)


Inherited from Object:

Public Fields

oAllocator* allocator

Public Methods

ovoid addOption(const char* name, int size, void* ptr, const char* help="")
ovoid addIOption(const char* name, int* ptr, int init_value, const char* help="")
ovoid addROption(const char* name, real* ptr, real init_value, const char* help="")
ovoid addBOption(const char* name, bool* ptr, bool init_value, const char* help="")
ovoid addOOption(const char* name, Object** ptr, Object* init_value, const char* help="")
ovoid setOption(const char* name, void* ptr)
ovoid setIOption(const char* name, int option)
ovoid setROption(const char* name, real option)
ovoid setBOption(const char* name, bool option)
ovoid setOOption(const char* name, Object* option)
ovoid load(const char* filename)
ovoid save(const char* filename)
ovoid* operator new(size_t size, Allocator* allocator_=NULL)
ovoid* operator new(size_t size, Allocator* allocator_, void* ptr_)
ovoid operator delete(void* ptr)


Documentation

Class for doing convolution over images.

Suppose you put n_input_planes images in each input frame. The images are in one big vector: each input frame has a size of n_input_planes*input_height*input_width. (image after image). Thus, n_inputs = n_input_planes*input_height*input_width.

Then, for each output planes, it computes the convolution of all input image planes with a kernel of size k_w*k_w*n_input_planes.

The output image size is computed in the constructor and put in output_height and output_width. n_outputs = n_output_planes*output_height*output_width.

Note that, depending of the size of your kernel, several (last) columns or rows of the input image could be lost.

Note also that no non-linearity is applied in this layer.

oint k_w
Kernel size (height and width)

oint d_x
'x' translation in the input image after each application of the kernel

oint d_y
'y' translation in the input image after each application of the kernel

oint n_input_planes
Number of input images

oint n_output_planes
Number of output images

oint input_height
Height of each input image

oint input_width
Width of each input image

oint output_height
Height of each output image

oint output_width
Width of each output image

oreal** weights
weights[i] means kernel-weights for output plane i. weights[i] contains n_input_planes times k_w*k_w weights.

oreal** der_weights
Derivatives associated to weights

oreal* biases
biases[i] is the bias for output plane i

oreal* der_biases
Derivatives associated to biases

o SpatialConvolution(int n_input_planes_, int n_output_planes_, int width_, int height_, int k_w_=5, int d_x_=1, int d_y_=1)
Create a convolution layer


This class has no child classes.
Author:
Ronan Collobert (collober@idiap.ch)

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.