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_layer
method in network class.Parameters: - input – An input
theano.tensor
variable. Eventheano.shared
will 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
pool
for details. {‘max’, ‘sum’, ‘mean’, ‘max_same_size’} - batch_norm – If provided will be used, default is
False
. - border_mode – Refer to
border_mode
variable inyann.core.conv
, module conv - stride – tuple
(int , int)
. Used as convolution stride. Default(1,1)
- rng – typically
numpy.random
. - borrow –
theano
borrow, typicallTrue
. - activation – String, takes options that are listed in
activations
Needed for layers that use activations. Some activations also take support parameters, for instancemaxout
takes maxout type and size,softmax
takes an option temperature. Refer to the moduleactivations
to know more. - input_params – Supply params or initializations from a pre-trained system.
Notes
Use
conv_pool_layer_2d.output
andconv_pool_layer_2d.output_shape
from this class.L1
andL2
are also public and can also can be used for regularization. The class also has in publicw
,b
,gamam
,beta
,``running_mean`` andrunning_var
which 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_layer
method in network class.Parameters: - input – An input
theano.tensor
variable. Eventheano.shared
will 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
pool
for details. {‘max’, ‘sum’, ‘mean’, ‘max_same_size’} - batch_norm – If provided will be used, default is
False
. - border_mode – Refer to
border_mode
variable inyann.core.conv
, module conv - stride – tuple
(int , int)
. Used as convolution stride. Default(1,1)
- rng – typically
numpy.random
. - borrow –
theano
borrow, typicallTrue
. - activation – String, takes options that are listed in
activations
Needed for layers that use activations. Some activations also take support parameters, for instancemaxout
takes maxout type and size,softmax
takes an option temperature. Refer to the moduleactivations
to know more. - input_params – Supply params or initializations from a pre-trained system.
Notes
Use
conv_pool_layer_2d.output
andconv_pool_layer_2d.output_shape
from this class.L1
andL2
are also public and can also can be used for regularization. The class also has in publicw
,b
,gamam
,beta
,``running_mean`` andrunning_var
which 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_layer
method in network class.Parameters: - input – An input
theano.tensor
variable. Eventheano.shared
will 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
pool
for details. {‘max’, ‘sum’, ‘mean’, ‘max_same_size’} - batch_norm – If provided will be used, default is
False
. - border_mode – Refer to
border_mode
variable inyann.core.conv
, moduleconv
- stride – tuple
(int , int)
. Used as convolution stride. Default(1,1)
- rng – typically
numpy.random
. - borrow –
theano
borrow, typicallTrue
. - activation – String, takes options that are listed in
activations
Needed for layers that use activations. Some activations also take support parameters, for instancemaxout
takes maxout type and size,softmax
takes an option temperature. Refer to the moduleactivations
to know more. - input_params – Supply params or initializations from a pre-trained system.
Notes
Use
conv_pool_layer_2d.output
andconv_pool_layer_2d.output_shape
from this class.L1
andL2
are also public and can also can be used for regularization. The class also has in publicw
,b
andalpha
which 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_layer
method in network class.Parameters: - input – An input
theano.tensor
variable. Eventheano.shared
will 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
pool
for details. {‘max’, ‘sum’, ‘mean’, ‘max_same_size’} - batch_norm – If provided will be used, default is
False
. - border_mode – Refer to
border_mode
variable inyann.core.conv
, moduleconv
- stride – tuple
(int , int)
. Used as convolution stride. Default(1,1)
- rng – typically
numpy.random
. - borrow –
theano
borrow, typicallTrue
. - activation – String, takes options that are listed in
activations
Needed for layers that use activations. Some activations also take support parameters, for instancemaxout
takes maxout type and size,softmax
takes an option temperature. Refer to the moduleactivations
to know more. - input_params – Supply params or initializations from a pre-trained system.
Notes
Use
conv_pool_layer_2d.output
andconv_pool_layer_2d.output_shape
from this class.L1
andL2
are also public and can also can be used for regularization. The class also has in publicw
,b
andalpha
which are also a list inparams
, another property of this class.- input – An input