input
- input layer classes¶
The file yann.layers.input.py
contains the definition for the input lyer modules.
-
class
yann.layers.input.
dropout_input_layer
(mini_batch_size, id, x, dropout_rate=0.5, height=28, width=28, channels=1, mean_subtract=False, rng=None, verbose=2)[source]¶ Creates a new input_layer. The layer doesn’t do much except to take the networks’ x and reshapes it into images. This is needed because yann dataset module assumes data in vectorized image formats as used in mnist - theano tutorials.
This class also creates a branch between a mean subtracted and non-mean subtracted input. It always assumes as default to use the non-mean subtracted input but if
mean_subtract
flag is provided, it will use the other option.Parameters: - x –
theano.tensor
variable with rows are vectorized images. if None, will create a new one. - mini_batch_size – Number of images in the data variable.
- height – Height of each image.
- width – Width of each image.
- channels – Number of channels in each image.
- mean_subtract – Defauly is
False
. - verbose – Similar to all of the toolbox.
Notes
Use
input_layer.output
to continue onwards with the networkinput_layer.output_shape
will tell you the output size.- x –
-
class
yann.layers.input.
dropout_tensor_layer
(id, input, input_shape, rng=None, dropout_rate=0.5, verbose=2)[source]¶ This converts a theano tensor or a shared value into a layer. Simply the value becomes the layer’s outptus.
Parameters: - input – some tensor
- input_shape – shape of the tensor
- dropout_rate – default is 0.5, typically.
- rng – Random number generator
- verbose – Similar to all of the toolbox.
Notes
Use
input_layer.output
to continue onwards with the networkinput_layer.output_shape
will tell you the output size.
-
class
yann.layers.input.
input_layer
(mini_batch_size, x, id=-1, height=28, width=28, channels=1, mean_subtract=False, verbose=2)[source]¶ reshapes it into images. This is needed because yann dataset module assumes data in vectorized image formats as used in mnist - theano tutorials.
This class also creates a branch between a mean subtracted and non-mean subtracted input. It always assumes as default to use the non-mean subtracted input but if
mean_subtract
flag is provided, it will use the other option.Parameters: - x –
theano.tensor
variable with rows are vectorized images. - y –
theano.tensor
variable - one_hot_y –
theano.tensor
variable - mini_batch_size – Number of images in the data variable.
- height – Height of each image.
- width – Width of each image.
- id – Supply a layer id
- channels – Number of channels in each image.
- mean_subtract – Defauly is
False
. - verbose – Similar to all of the toolbox.
Notes
Use
input_layer.output
to continue onwards with the networkinput_layer.output_shape
will tell you the output size. Useinput_layer.x
,input_layer.y
andinput_layer_one_hot_y
tensors for connections.- x –
-
class
yann.layers.input.
tensor_layer
(id, input, input_shape, verbose=2)[source]¶ This converts a theano tensor or a shared value into a layer. Simply the value becomes the layer’s outptus.
Parameters: - input – some tensor
- input_shape – shape of the tensor
- verbose – Similar to all of the toolbox.
Notes
Use
input_layer.output
to continue onwards with the networkinput_layer.output_shape
will tell you the output size.