theanets.layers.recurrent.GRU¶
-
class
theanets.layers.recurrent.
GRU
(**kwargs)¶ Gated Recurrent Unit layer.
The implementation is from J Chung, C Gulcehre, KH Cho, & Y Bengio (2014), “Empirical Evaluation of Gated Recurrent Neural Networks on Sequence Modeling” (page 4), available at http://arxiv.org/abs/1412.3555v1.
-
__init__
(**kwargs)¶
Methods
__init__
(**kwargs)add_weights
(name, nin, nout[, mean, std, ...])Helper method to create a new weight matrix. initial_state
(name, batch_size)Return an array of suitable for representing initial state. setup
()transform
(inputs)Transform inputs to this layer into outputs 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. -
transform
(inputs)¶ Transform inputs to this layer into outputs 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
base.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, a “hid” output that gives the post-activation values before applying the rate mixing, and an “out” output that gives the overall output.
updates : sequence of update pairs
A sequence of updates to apply to this layer’s state inside a theano function.
-