dlpy.layers.Recurrent

class dlpy.layers.Recurrent(n, name=None, act='AUTO', fcmp_act=None, init=None, std=None, mean=None, truncation_factor=None, rnn_type='LSTM', output_type='ENCODING', max_output_length=None, reversed_=None, dropout=None, init_bias=None, src_layers=None)

Bases: dlpy.layers.Layer

RNN layer

Parameters:
n : int

Specifies the number of neurons.

name : string, optional

Specifies the name of the layer.

act : string, optional

Specifies the activation function.
Valid Values: AUTO, IDENTITY, LOGISTIC, SIGMOID, TANH, RECTIFIER, RELU, SOFPLUS, ELU, LEAKY, FCMP
Default: AUTO

fcmp_act : string, optional

Specifies the FCMP activation function for the layer.

init : string, optional

Specifies the initialization scheme for the layer.
Valid Values: XAVIER, UNIFORM, NORMAL, CAUCHY, XAVIER1, XAVIER2, MSRA, MSRA1, MSRA2
Default: XAVIER

std : float, optional

Specifies the standard deviation value when the init parameter is set to NORMAL.

mean : float, optional

Specifies the mean value when the init parameter is set to NORMAL.

truncation_factor : float, optional

Specifies the truncation threshold (truncationFactor x std), when the init parameter is set to NORMAL

rnn_type : string, optional

Specifies the type of the rnn layer. Possible Values: RNN, LSTM, GRU
Default: RNN

output_type : string, optional

Specifies the output type of the recurrent layer.
Valid Values: ENCODING, SAMELENGTH, ARBITRARYLENGTH
Default: ENCODING

max_output_length : int, optional

Specifies the maximum number of tokens to generate when the outputType parameter is set to ARBITRARYLENGTH.

reversed : bool, optional

Specifies the direction of the rnn layer.
Default: False

dropout : float, optional

Specifies the dropout rate.
Default: 0

init_bias : float, optional

Specifies the initial bias for the layer.
Default: None

src_layers : iter-of-Layers, optional

Specifies the layers directed to this layer.

Returns:
Recurrent
__init__(n, name=None, act='AUTO', fcmp_act=None, init=None, std=None, mean=None, truncation_factor=None, rnn_type='LSTM', output_type='ENCODING', max_output_length=None, reversed_=None, dropout=None, init_bias=None, src_layers=None)

Initialize self. See help(type(self)) for accurate signature.

Methods

__init__(n[, name, act, fcmp_act, init, …]) Initialize self.
count_instances()
format_name([block_num, local_count]) Format the name of the layer
get_number_of_instances()
to_model_params() Convert the model configuration to CAS action parameters