LostTech.TensorFlow : API Documentation

Type PeepholeLSTMCell

Namespace tensorflow.keras.experimental

Parent LSTMCell

Interfaces IPeepholeLSTMCell

Equivalent to 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.](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:

[Long short-term memory recurrent neural network architectures for large scale acoustic modeling. ](https://research.google.com/pubs/archive/43905.pdf)

Example:
Show Example
# Create 2 PeepholeLSTMCells
            peephole_lstm_cells = [PeepholeLSTMCell(size) for size in [128, 256]]
            # Create a layer composed sequentially of the peephole LSTM cells.
            layer = RNN(peephole_lstm_cells)
            input = keras.Input((timesteps, input_dim))
            output = layer(input) 

Methods

Properties

Public instance methods

void build(int32 input_shape)

void build(IEnumerable<object> input_shape)

void build(ValueTuple<int, object> input_shape)

void build(ValueTuple<Nullable<int>> input_shape)

void build(Dimension input_shape)

Tensor call(IGraphNodeBase inputs, IEnumerable<IGraphNodeBase> states, IGraphNodeBase training)

Tensor call(IGraphNodeBase inputs, object states, IGraphNodeBase training)

Tensor call(IGraphNodeBase inputs, PythonClassContainer states, bool training)

Tensor call(IGraphNodeBase inputs, IEnumerable<IGraphNodeBase> states, bool training)

Tensor call(IEnumerable<IGraphNodeBase> inputs, object states, IGraphNodeBase training)

Tensor call(IEnumerable<IGraphNodeBase> inputs, PythonClassContainer states, IGraphNodeBase training)

Tensor call(IGraphNodeBase inputs, PythonClassContainer states, IGraphNodeBase training)

Tensor call(IEnumerable<IGraphNodeBase> inputs, PythonClassContainer states, bool training)

Tensor call(IEnumerable<IGraphNodeBase> inputs, IEnumerable<IGraphNodeBase> states, IGraphNodeBase training)

Tensor call(IEnumerable<IGraphNodeBase> inputs, IEnumerable<IGraphNodeBase> states, bool training)

Tensor call(IEnumerable<IGraphNodeBase> inputs, object states, bool training)

Tensor call(IGraphNodeBase inputs, object states, bool training)

object get_dropout_mask_for_cell(IGraphNodeBase inputs, bool training, int count)

object get_dropout_mask_for_cell(IEnumerable<IGraphNodeBase> inputs, IGraphNodeBase training, int count)

object get_dropout_mask_for_cell(IEnumerable<IGraphNodeBase> inputs, int training, int count)

object get_dropout_mask_for_cell(IGraphNodeBase inputs, IGraphNodeBase training, int count)

object get_dropout_mask_for_cell(IGraphNodeBase inputs, int training, int count)

object get_dropout_mask_for_cell(IEnumerable<IGraphNodeBase> inputs, bool training, int count)

object get_dropout_mask_for_cell_dyn(object inputs, object training, ImplicitContainer<T> count)

object get_recurrent_dropout_mask_for_cell(ValueTuple<object, object, object, object> inputs, bool training, int count)

object get_recurrent_dropout_mask_for_cell(ValueTuple<object, object, object, object> inputs, IGraphNodeBase training, int count)

object get_recurrent_dropout_mask_for_cell(ValueTuple<object, object, object, object> inputs, int training, int count)

object get_recurrent_dropout_mask_for_cell_dyn(object inputs, object training, ImplicitContainer<T> count)

void reset_dropout_mask()

object reset_dropout_mask_dyn()

void reset_recurrent_dropout_mask()

object reset_recurrent_dropout_mask_dyn()

Public static methods

PeepholeLSTMCell NewDyn(object units, ImplicitContainer<T> activation, ImplicitContainer<T> recurrent_activation, ImplicitContainer<T> use_bias, ImplicitContainer<T> kernel_initializer, ImplicitContainer<T> recurrent_initializer, ImplicitContainer<T> bias_initializer, ImplicitContainer<T> unit_forget_bias, object kernel_regularizer, object recurrent_regularizer, object bias_regularizer, object kernel_constraint, object recurrent_constraint, object bias_constraint, ImplicitContainer<T> dropout, ImplicitContainer<T> recurrent_dropout, ImplicitContainer<T> implementation, IDictionary<string, object> kwargs)

Public properties

object activation get; set;

PythonFunctionContainer activity_regularizer get; set;

object activity_regularizer_dyn get; set;

object bias get; set;

object bias_constraint get; set;

object bias_initializer get; set;

object bias_regularizer get; set;

bool built get; set;

double dropout get; set;

object dtype get;

object dtype_dyn get;

bool dynamic get;

object dynamic_dyn get;

object forget_gate_peephole_weights get; set;

int implementation get; set;

IList<Node> inbound_nodes get;

object inbound_nodes_dyn get;

IList<object> input get;

object input_dyn get;

object input_gate_peephole_weights get; set;

object input_mask get;

object input_mask_dyn get;

IList<object> input_shape get;

object input_shape_dyn get;

object input_spec get; set;

object input_spec_dyn get; set;

object kernel get; set;

object kernel_constraint get; set;

object kernel_initializer get; set;

object kernel_regularizer get; set;

IList<object> losses get;

object losses_dyn get;

IList<object> metrics get;

object metrics_dyn get;

object name get;

object name_dyn get;

object name_scope get;

object name_scope_dyn get;

IList<object> non_trainable_variables get;

object non_trainable_variables_dyn get;

IList<object> non_trainable_weights get;

object non_trainable_weights_dyn get;

IList<object> outbound_nodes get;

object outbound_nodes_dyn get;

IList<object> output get;

object output_dyn get;

object output_gate_peephole_weights get; set;

object output_mask get;

object output_mask_dyn get;

object output_shape get;

object output_shape_dyn get;

int output_size get; set;

object PythonObject get;

object recurrent_activation get; set;

object recurrent_constraint get; set;

double recurrent_dropout get; set;

object recurrent_initializer get; set;

object recurrent_kernel get; set;

object recurrent_regularizer get; set;

NoDependency state_size get; set;

bool stateful get; set;

ValueTuple<object> submodules get;

object submodules_dyn get;

bool supports_masking get; set;

bool trainable get; set;

object trainable_dyn get; set;

object trainable_variables get;

object trainable_variables_dyn get;

IList<object> trainable_weights get;

object trainable_weights_dyn get;

bool unit_forget_bias get; set;

int units get; set;

IList<object> updates get;

object updates_dyn get;

bool use_bias get; set;

object variables get;

object variables_dyn get;

IList<object> weights get;

object weights_dyn get;