conv_pool - conv pool layer classes¶
The file yann.layers.conv_pool.py contains the definition for the conv pool layers.
Todo
- Need to the deconvolutional-unpooling layer.
- Something is still not good about the convolutional batch norm layer.
-
class
yann.layers.conv_pool.conv_pool_layer_2d(input, nkerns, input_shape, id, filter_shape=(3, 3), poolsize=(2, 2), pooltype='max', batch_norm=False, border_mode='valid', stride=(1, 1), rng=None, borrow=True, activation='relu', input_params=None, verbose=2)[source]¶ This class is the typical 2D convolutional pooling and batch normalizationlayer. It is called by the
add_layermethod in network class.Parameters: - input – An input
theano.tensorvariable. Eventheano.sharedwill work as long as they are in the following shapemini_batch_size, height, width, channels - verbose – similar to the rest of the toolbox.
- nkerns – number of neurons in the layer
- input_shape –
(mini_batch_size, channels, height, width) - filter_shape – (<int>,<int>)
- pool_size – Subsample size, default is
(1,1). - pool_type – Refer to
poolfor details. {‘max’, ‘sum’, ‘mean’, ‘max_same_size’} - batch_norm – If provided will be used, default is
False. - border_mode – Refer to
border_modevariable inyann.core.conv, module conv - stride – tuple
(int , int). Used as convolution stride. Default(1,1) - rng – typically
numpy.random. - borrow –
theanoborrow, typicallTrue. - activation – String, takes options that are listed in
activationsNeeded for layers that use activations. Some activations also take support parameters, for instancemaxouttakes maxout type and size,softmaxtakes an option temperature. Refer to the moduleactivationsto know more. - input_params – Supply params or initializations from a pre-trained system.
Notes
Use
conv_pool_layer_2d.outputandconv_pool_layer_2d.output_shapefrom this class.L1andL2are also public and can also can be used for regularization. The class also has in publicw,b,gamam,beta,``running_mean`` andrunning_varwhich are also a list inparams, another property of this class.- input – An input
-
class
yann.layers.conv_pool.deconv_layer_2d(input, nkerns, input_shape, id, output_shape, filter_shape=(3, 3), poolsize=(1, 1), pooltype='max', batch_norm=False, border_mode='valid', stride=(1, 1), rng=None, borrow=True, activation='relu', input_params=None, verbose=2)[source]¶ This class is the typical 2D convolutional pooling and batch normalizationlayer. It is called by the
add_layermethod in network class.Parameters: - input – An input
theano.tensorvariable. Eventheano.sharedwill work as long as they are in the following shapemini_batch_size, height, width, channels - verbose – similar to the rest of the toolbox.
- nkerns – number of neurons in the layer
- input_shape –
(mini_batch_size, channels, height, width) - filter_shape – (<int>,<int>)
- pool_size – Subsample size, default is
(1,1). Right now does not take a pooling. - pool_type – Refer to
poolfor details. {‘max’, ‘sum’, ‘mean’, ‘max_same_size’} - batch_norm – If provided will be used, default is
False. - border_mode – Refer to
border_modevariable inyann.core.conv, module conv - stride – tuple
(int , int). Used as convolution stride. Default(1,1) - rng – typically
numpy.random. - borrow –
theanoborrow, typicallTrue. - activation – String, takes options that are listed in
activationsNeeded for layers that use activations. Some activations also take support parameters, for instancemaxouttakes maxout type and size,softmaxtakes an option temperature. Refer to the moduleactivationsto know more. - input_params – Supply params or initializations from a pre-trained system.
Notes
Use
conv_pool_layer_2d.outputandconv_pool_layer_2d.output_shapefrom this class.L1andL2are also public and can also can be used for regularization. The class also has in publicw,b,gamam,beta,``running_mean`` andrunning_varwhich are also a list inparams, another property of this class.- input – An input
-
class
yann.layers.conv_pool.dropout_conv_pool_layer_2d(input, nkerns, input_shape, id, dropout_rate=0.5, filter_shape=(3, 3), poolsize=(2, 2), pooltype='max', batch_norm=True, border_mode='valid', stride=(1, 1), rng=None, borrow=True, activation='relu', input_params=None, verbose=2)[source]¶ This class is the typical 2D convolutional pooling and batch normalizationlayer. It is called by the
add_layermethod in network class.Parameters: - input – An input
theano.tensorvariable. Eventheano.sharedwill work as long as they are in the following shapemini_batch_size, height, width, channels - verbose – similar to the rest of the toolbox.
- nkerns – number of neurons in the layer
- input_shape –
(mini_batch_size, channels, height, width) - filter_shape – (<int>,<int>)
- pool_size – Subsample size, default is
(1,1). - pool_type – Refer to
poolfor details. {‘max’, ‘sum’, ‘mean’, ‘max_same_size’} - batch_norm – If provided will be used, default is
False. - border_mode – Refer to
border_modevariable inyann.core.conv, moduleconv - stride – tuple
(int , int). Used as convolution stride. Default(1,1) - rng – typically
numpy.random. - borrow –
theanoborrow, typicallTrue. - activation – String, takes options that are listed in
activationsNeeded for layers that use activations. Some activations also take support parameters, for instancemaxouttakes maxout type and size,softmaxtakes an option temperature. Refer to the moduleactivationsto know more. - input_params – Supply params or initializations from a pre-trained system.
Notes
Use
conv_pool_layer_2d.outputandconv_pool_layer_2d.output_shapefrom this class.L1andL2are also public and can also can be used for regularization. The class also has in publicw,bandalphawhich are also a list inparams, another property of this class.- input – An input
-
class
yann.layers.conv_pool.dropout_deconv_layer_2d(input, nkerns, input_shape, id, output_shape, dropout_rate=0.5, filter_shape=(3, 3), poolsize=(1, 1), pooltype='max', batch_norm=True, border_mode='valid', stride=(1, 1), rng=None, borrow=True, activation='relu', input_params=None, verbose=2)[source]¶ This class is the typical 2D deconvolutional and batch normalization layer. It is called by the
add_layermethod in network class.Parameters: - input – An input
theano.tensorvariable. Eventheano.sharedwill work as long as they are in the following shapemini_batch_size, height, width, channels - verbose – similar to the rest of the toolbox.
- nkerns – number of neurons in the layer
- input_shape –
(mini_batch_size, channels, height, width) - filter_shape – (<int>,<int>)
- pool_size – Subsample size, default is
(1,1). - pool_type – Refer to
poolfor details. {‘max’, ‘sum’, ‘mean’, ‘max_same_size’} - batch_norm – If provided will be used, default is
False. - border_mode – Refer to
border_modevariable inyann.core.conv, moduleconv - stride – tuple
(int , int). Used as convolution stride. Default(1,1) - rng – typically
numpy.random. - borrow –
theanoborrow, typicallTrue. - activation – String, takes options that are listed in
activationsNeeded for layers that use activations. Some activations also take support parameters, for instancemaxouttakes maxout type and size,softmaxtakes an option temperature. Refer to the moduleactivationsto know more. - input_params – Supply params or initializations from a pre-trained system.
Notes
Use
conv_pool_layer_2d.outputandconv_pool_layer_2d.output_shapefrom this class.L1andL2are also public and can also can be used for regularization. The class also has in publicw,bandalphawhich are also a list inparams, another property of this class.- input – An input