Options
All
  • Public
  • Public/Protected
  • All
Menu

An LSTM cell with a dense layer on its top.

Hierarchy

  • LSTM

Index

Constructors

constructor

  • new LSTM(inputSize: number, hiddenSize: number, outputSize: number, dropout?: number): LSTM
  • Parameters

    • inputSize: number

      The dimension of the input data.

    • hiddenSize: number

      The dimension of the output of the LSTM, passed to the dense layer.

    • outputSize: number

      The dimension of the output data.

    • Default value dropout: number = 0.2

      The dropout rate between the LSTM cell and the dense layer.

    Returns LSTM

Properties

Private denseBias

denseBias: Tensor

Private denseWeights

denseWeights: Tensor

dropout

dropout: number

Private lstmBias

lstmBias: Tensor

Private lstmForgetBias

lstmForgetBias: Tensor

Private lstmInitC

lstmInitC: Tensor

Private lstmInitH

lstmInitH: Tensor

Private lstmKernel

lstmKernel: Tensor

Methods

export

  • export(): Promise<{}>
  • Return all the LSTM model parameters.

    Returns Promise<{}>

initLSTM

  • initLSTM(clone?: boolean): { c: tf.Tensor2D; h: tf.Tensor2D }
  • Gives the initial state values of the LSTM (c and h).

    Parameters

    • Default value clone: boolean = true

      If it is necessary to clone states variable or no.

    Returns { c: tf.Tensor2D; h: tf.Tensor2D }

    • c: tf.Tensor2D
    • h: tf.Tensor2D

load

  • load(weights: {}): void
  • Update the given model parameters.

    Parameters

    • weights: {}
      • [key: string]: any

    Returns void

predict

  • predict(x: tf.Tensor1D, c: tf.Tensor2D, h: tf.Tensor2D, mask?: tf.Tensor1D, temperature?: number): LSTMPrediction
  • Make a prediction given an input and state values (c and h).

    Parameters

    • x: tf.Tensor1D

      A vector of shape [inputSize].

    • c: tf.Tensor2D

      LSTM's state value.

    • h: tf.Tensor2D

      LSTM's last output value.

    • Optional mask: tf.Tensor1D

      A vector of ones and zeros of shape [outputSize].

    • Default value temperature: number = 1

    Returns LSTMPrediction

Legend

  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Function
  • Type alias
  • Enumeration
  • Interface
  • Private property

Generated using TypeDoc