class_docstr: Equivalent to `tf.keras.layers.LSTMCell` class but adds peephole connections.
  
  Peephole connections allow the gates to utilize the previous internal state as
  well as the previous hidden state (which is what LSTMCell is limited to).
  This allows PeepholeLSTMCell to better learn precise timings over LSTMCell.
  
  From [Gers et al., 2002](
  http://www.jmlr.org/papers/volume3/gers02a/gers02a.pdf):
  
  "We find that LSTM augmented by 'peephole connections' from its internal
  cells to its multiplicative gates can learn the fine distinction between
  sequences of spikes spaced either 50 or 49 time steps apart without the help
  of any short training exemplars."
  
  The peephole implementation is based on:
  
  [Sak et al., 2014](https://research.google.com/pubs/archive/43905.pdf)
  
  Example:
  
  >>> inputs = np.random.random([30,23,9]).astype(np.float32)
  >>> LSTMCell = tfa.rnn.PeepholeLSTMCell(4)
  >>> rnn = tf.keras.layers.RNN(LSTMCell, return_sequences=True, return_state=True)
  >>> outputs, memory_state, carry_state = rnn(inputs)
  >>> outputs.shape
  TensorShape([30, 23, 4])
  >>> memory_state.shape
  TensorShape([30, 4])
  >>> carry_state.shape
  TensorShape([30, 4])
class_docstr_tok: ["Equivalent","to","`","tf.keras.layers.LSTMCell","`","class","but","adds","peephole","connections",".","Peephole","connections","allow","the","gates","to","utilize","the","previous","internal","state","as","well","as","the","previous","hidden","state","(","which","is","what","LSTMCell","is","limited","to",")",".","This","allows","PeepholeLSTMCell","to","better","learn","precise","timings","over","LSTMCell",".","From","[","Gers","et","al.",",","2002","]","(","http",":","\/\/www.jmlr.org\/papers\/volume3\/gers02a\/gers02a.pdf",")",":","''","We","find","that","LSTM","augmented","by","'peephole","connections","'","from","its","internal","cells","to","its","multiplicative","gates","can","learn","the","fine","distinction","between","sequences","of","spikes","spaced","either","50","or","49","time","steps","apart","without","the","help","of","any","short","training","exemplars",".","''","The","peephole","implementation","is","based","on",":","[","Sak","et","al.",",","2014","]","(","https",":","\/\/research.google.com\/pubs\/archive\/43905.pdf",")","Example",":",">",">",">","inputs","=","np.random.random","(","[","30,23,9","]",")",".astype","(","np.float32",")",">",">",">","LSTMCell","=","tfa.rnn.PeepholeLSTMCell","(","4",")",">",">",">","rnn","=","tf.keras.layers.RNN","(","LSTMCell",",","return_sequences=True",",","return_state=True",")",">",">",">","outputs",",","memory_state",",","carry_state","=","rnn","(","inputs",")",">",">",">","outputs.shape","TensorShape","(","[","30",",","23",",","4","]",")",">",">",">","memory_state.shape","TensorShape","(","[","30",",","4","]",")",">",">",">","carry_state.shape","TensorShape","(","[","30",",","4","]",")"]
code: def build(self, input_shape):
      super().build(input_shape)
      # The following are the weight matrices for the peephole connections. These
      # are multiplied with the previous internal state during the computation of
      # carry and output.
      self.input_gate_peephole_weights = self.add_weight(
          shape=(self.units,),
          name="input_gate_peephole_weights",
          initializer=self.kernel_initializer,
      )
      self.forget_gate_peephole_weights = self.add_weight(
          shape=(self.units,),
          name="forget_gate_peephole_weights",
          initializer=self.kernel_initializer,
      )
      self.output_gate_peephole_weights = self.add_weight(
          shape=(self.units,),
          name="output_gate_peephole_weights",
          initializer=self.kernel_initializer,
      )
  
imports: import tensorflow
label_desc: Use image node_id 1 for calling the PeepholeLSTMCell obj's underlying member method code with example usage: obj.build(input_shape) without return types