theanets.layers.convolution.Conv1¶
-
class
theanets.layers.convolution.
Conv1
(filter_size, stride=1, border_mode='valid', **kwargs)¶ 1-dimensional convolutions run over one data axis.
One-dimensional convolution layers can only be included in
theanets
models that use recurrent inputs and outputs, i.e.,theanets.recurrent.Autoencoder
,theanets.recurrent.Predictor
,theanets.recurrent.Classifier
, ortheanets.recurrent.Regressor
. The convolution will always be applied over the “time” dimension (axis 1).Parameters: filter_size : int
Length of the convolution filters for this layer.
stride : int, optional
Apply convolutions with this stride; i.e., skip this many samples between convolutions. Defaults to 1, i.e., no skipping.
border_mode : str, optional
Compute convolutions with this border mode. Defaults to ‘valid’.
-
__init__
(filter_size, stride=1, border_mode='valid', **kwargs)¶
Methods
__init__
(filter_size[, stride, border_mode])add_bias
(name, size[, mean, std])Helper method to create a new bias vector. add_conv_weights
(name[, mean, std, sparsity])Add a convolutional weight array to this layer’s parameters. add_weights
(name, nin, nout[, mean, std, ...])Helper method to create a new weight matrix. connect
(inputs)Create Theano variables representing the outputs of this layer. find
(key)Get a shared variable for a parameter by name. log
()Log some information about this layer. output_name
([name])Return a fully-scoped name for the given layer output. setup
()Set up the parameters and initial values for this layer. to_spec
()Create a specification dictionary for this layer. transform
(inputs)Transform the inputs for this layer into an output for the layer. Attributes
input_size
For networks with one input, get the input size. num_params
Total number of learnable parameters in this layer. params
A list of all parameters in this layer. -
setup
()¶ Set up the parameters and initial values for this layer.
-
transform
(inputs)¶ Transform the inputs for this layer into an output for the layer.
Parameters: inputs : dict of Theano expressions
Symbolic inputs to this layer, given as a dictionary mapping string names to Theano expressions. See
Layer.connect()
.Returns: outputs : dict of Theano expressions
A map from string output names to Theano expressions for the outputs from this layer. This layer type generates a “pre” output that gives the unit activity before applying the layer’s activation function, and an “out” output that gives the post-activation output.
updates : list of update pairs
A sequence of updates to apply inside a Theano function.
-