Recurrent layers¶
Recurrent layers
RNN |
RNN layer |
-
class
braid.berry.layers.RNN(incoming, num_units, num_of_cells, cell_type='LSTM', return_cell_out=False, use_peepholes=False, cell_clip=None, pad='VALID', activation=None, init=None, W_stddev=0.01, b_val=0.1, **kwargs)¶ RNN layer
- incoming :
- Parent layer, whose output is given as input to the current layer.
- num_units : int
- The number of output units.
- num_of_cells : int
- The number of cells/steps in the layer.
- cell_type : string, optional (default = “LSTM”)
- Type of recurrent cell to be used.
- activation : string, optional (default = “linear”)
- Nonlinearity to apply afer performing convolution. See
berry.activations - return_cell_out : bool, optional (default = False)
- If true output from all cells are returned as 3d tensor, otherwise just final output as 2d tensor.
- W_stddev : float, optional (default = 1e-2)
- Standard deviation for Normal distribution to initialize the weights,
if
init = None. - b_val : float, optional (default = 0.1)
- Constant value to initialize the biases.
- W :
- Weight tensor in case if the layer has any trainable parameters
(inherited from
Layer). - b :
- Bias vector in case of trainable parameters (inherited from
Layer). - name : string, optional (default = None)
- Name of the layer. Should be specified for better readability (
inherited from
Layer).
Layerortf.Tensortf.Variable, optional (default = None)tf.Variable, optional (default = None)- input_layer :
- Input layer to this layer.
- input_shape : tuple
- Shape of the incoming layer.
- output :
- The Tensor obtained after performing the transformation applied by this layer.
- output_shape : tuple
- Shape of the output tensor.
- type : string
- Return the name of the class.
Layerortf.Tensortf.TensorSee also
Inherits class
Layer.-
get_output_for()¶ Perform the convolution operation, activation and return the output
tf.Tensor.tf.Tensor- Output tensor of this layer.
-
get_output_shape_for(input_shape)¶ Shape of the output tensor after performing convolution.
- input_shape : tuple or list
- Shape of the input layer.
- tuple
- Shape of the output tensor.
-
validate_input_layer(incoming)¶ Validate the input layer shape
Returns
Trueif the input layer is 4D else, raise anexceptions.AssertError.