(self, num_units, input_size=None,
                 use_peepholes=False, cell_clip=None,
                 initializer=None, num_proj=None, proj_clip=None,
                 num_unit_shards=None, num_proj_shards=None,
                 forget_bias=1.0, state_is_tuple=True,
                 activation=tanh, alpha=0.001, r_on_init=0.05, tau_init=6.,
                 manual_set=False, trainable=True, reuse=None)
Initialize the parameters for an LSTM cell.
    
        Args:
          num_units: int, The number of units in the LSTM cell
          input_size: Deprecated and unused.
          use_peepholes: bool, set True to enable diagonal/peephole connections.
          cell_clip: (optional) A float value, if provided the cell state is clipped
            by this value prior to the cell output activation.
          initializer: (optional) The initializer to use for the weight and
            projection matrices.
          num_proj: (optional) int, The output dimensionality for the projection
            matrices.  If None, no projection is performed.
          proj_clip: (optional) A float value.  If `num_proj > 0` and `proj_clip` is
            provided, then the projected values are clipped elementwise to within
            `[-proj_clip, proj_clip]`.
          num_unit_shards: Deprecated, will be removed by Jan. 2017.
            Use a variable_scope partitioner instead.
          num_proj_shards: Deprecated, will be removed by Jan. 2017.
            Use a variable_scope partitioner instead.
          forget_bias: Biases of the forget gate are initialized by default to 1
            in order to reduce the scale of forgetting at the beginning of
            the training.
          state_is_tuple: If True, accepted and returned states are 2-tuples of
            the `c_state` and `m_state`.  If False, they are concatenated
            along the column axis.  This latter behavior will soon be deprecated.
          activation: Activation function of the inner states.
Initialize the parameters for an LSTM cell.
    
        Args:
          num_units: int, The number of units in the LSTM cell
          input_size: Deprecated and unused.
          use_peepholes: bool, set True to enable diagonal/peephole connections.
          cell_clip: (optional) A float value, if provided the cell state is clipped
            by this value prior to the cell output activation.
          initializer: (optional) The initializer to use for the weight and
            projection matrices.
          num_proj: (optional) int, The output dimensionality for the projection
            matrices.  If None, no projection is performed.
          proj_clip: (optional) A float value.  If `num_proj > 0` and `proj_clip` is
            provided, then the projected values are clipped elementwise to within
            `[-proj_clip, proj_clip]`.
          num_unit_shards: Deprecated, will be removed by Jan. 2017.
            Use a variable_scope partitioner instead.
          num_proj_shards: Deprecated, will be removed by Jan. 2017.
            Use a variable_scope partitioner instead.
          forget_bias: Biases of the forget gate are initialized by default to 1
            in order to reduce the scale of forgetting at the beginning of
            the training.
          state_is_tuple: If True, accepted and returned states are 2-tuples of
            the `c_state` and `m_state`.  If False, they are concatenated
            along the column axis.  This latter behavior will soon be deprecated.
          activation: Activation function of the inner states.
Initialize the parameters for an LSTM cell . Args : num_units : int The number of units in the LSTM cell input_size : Deprecated and unused . use_peepholes : bool set True to enable diagonal / peephole connections . cell_clip : ( optional ) A float value if provided the cell state is clipped by this value prior to the cell output activation . initializer : ( optional ) The initializer to use for the weight and projection matrices . num_proj : ( optional ) int The output dimensionality for the projection matrices . If None no projection is performed . proj_clip : ( optional ) A float value . If num_proj > 0 and proj_clip is provided then the projected values are clipped elementwise to within [ - proj_clip proj_clip ] . num_unit_shards : Deprecated will be removed by Jan . 2017 . Use a variable_scope partitioner instead . num_proj_shards : Deprecated will be removed by Jan . 2017 . Use a variable_scope partitioner instead . forget_bias : Biases of the forget gate are initialized by default to 1 in order to reduce the scale of forgetting at the beginning of the training . state_is_tuple : If True accepted and returned states are 2 - tuples of the c_state and m_state . If False they are concatenated along the column axis . This latter behavior will soon be deprecated . activation : Activation function of the inner states .
def __init__(self, num_units, input_size=None,
                 use_peepholes=False, cell_clip=None,
                 initializer=None, num_proj=None, proj_clip=None,
                 num_unit_shards=None, num_proj_shards=None,
                 forget_bias=1.0, state_is_tuple=True,
                 activation=tanh, alpha=0.001, r_on_init=0.05, tau_init=6.,
                 manual_set=False, trainable=True, reuse=None):
        super(PhasedLSTMCell, self).__init__(_reuse=reuse)
        """Initialize the parameters for an LSTM cell.
    
        Args:
          num_units: int, The number of units in the LSTM cell
          input_size: Deprecated and unused.
          use_peepholes: bool, set True to enable diagonal/peephole connections.
          cell_clip: (optional) A float value, if provided the cell state is clipped
            by this value prior to the cell output activation.
          initializer: (optional) The initializer to use for the weight and
            projection matrices.
          num_proj: (optional) int, The output dimensionality for the projection
            matrices.  If None, no projection is performed.
          proj_clip: (optional) A float value.  If `num_proj > 0` and `proj_clip` is
            provided, then the projected values are clipped elementwise to within
            `[-proj_clip, proj_clip]`.
          num_unit_shards: Deprecated, will be removed by Jan. 2017.
            Use a variable_scope partitioner instead.
          num_proj_shards: Deprecated, will be removed by Jan. 2017.
            Use a variable_scope partitioner instead.
          forget_bias: Biases of the forget gate are initialized by default to 1
            in order to reduce the scale of forgetting at the beginning of
            the training.
          state_is_tuple: If True, accepted and returned states are 2-tuples of
            the `c_state` and `m_state`.  If False, they are concatenated
            along the column axis.  This latter behavior will soon be deprecated.
          activation: Activation function of the inner states.
        """
        if not state_is_tuple:
            logging.warn("%s: Using a concatenated state is slower and will soon be "
                         "deprecated.  Use state_is_tuple=True.", self)
        if input_size is not None:
            logging.warn("%s: The input_size parameter is deprecated.", self)
        if num_unit_shards is not None or num_proj_shards is not None:
            logging.warn(
                "%s: The num_unit_shards and proj_unit_shards parameters are "
                "deprecated and will be removed in Jan 2017.  "
                "Use a variable scope with a partitioner instead.", self)
        
        self._num_units = num_units
        self._use_peepholes = use_peepholes
        self._cell_clip = cell_clip
        self._initializer = initializer
        self._num_proj = num_proj
        self._proj_clip = proj_clip
        self._num_unit_shards = num_unit_shards
        self._num_proj_shards = num_proj_shards
        self._forget_bias = forget_bias
        self._state_is_tuple = state_is_tuple
        self._activation = activation
        self.alpha = alpha
        self.r_on_init = r_on_init
        self.tau_init = tau_init
        
        self.manual_set = manual_set
        self.trainable = trainable
        
        if num_proj:
            self._state_size = (
                LSTMStateTuple(num_units, num_proj)
                if state_is_tuple else num_units + num_proj)
            self._output_size = num_proj
        else:
            self._state_size = (
                LSTMStateTuple(num_units, num_units)
                if state_is_tuple else 2 * num_units)
            self._output_size = num_units
def __init__ ( self , num_units , input_size = None , use_peepholes = False , cell_clip = None , initializer = None , num_proj = None , proj_clip = None , num_unit_shards = None , num_proj_shards = None , forget_bias = 1.0 , state_is_tuple = True , activation = tanh , alpha = 0.001 , r_on_init = 0.05 , tau_init = 6. , manual_set = False , trainable = True , reuse = None ) : super ( PhasedLSTMCell , self ) . __init__ ( _reuse = reuse ) if not state_is_tuple : logging . warn ( "%s: Using a concatenated state is slower and will soon be " "deprecated.  Use state_is_tuple=True." , self ) if input_size is not None : logging . warn ( "%s: The input_size parameter is deprecated." , self ) if num_unit_shards is not None or num_proj_shards is not None : logging . warn ( "%s: The num_unit_shards and proj_unit_shards parameters are " "deprecated and will be removed in Jan 2017.  " "Use a variable scope with a partitioner instead." , self ) self . _num_units = num_units self . _use_peepholes = use_peepholes self . _cell_clip = cell_clip self . _initializer = initializer self . _num_proj = num_proj self . _proj_clip = proj_clip self . _num_unit_shards = num_unit_shards self . _num_proj_shards = num_proj_shards self . _forget_bias = forget_bias self . _state_is_tuple = state_is_tuple self . _activation = activation self . alpha = alpha self . r_on_init = r_on_init self . tau_init = tau_init self . manual_set = manual_set self . trainable = trainable if num_proj : self . _state_size = ( LSTMStateTuple ( num_units , num_proj ) if state_is_tuple else num_units + num_proj ) self . _output_size = num_proj else : self . _state_size = ( LSTMStateTuple ( num_units , num_units ) if state_is_tuple else 2 * num_units ) self . _output_size = num_units