LSTM
public struct LSTM<Element, Device> : RNN, Codable where Element : RandomizableType, Device : DeviceType
Undocumented
-
Declaration
Swift
public typealias Inputs = Tensor<Element, Device>
-
Declaration
Swift
public var parameterPaths: [WritableKeyPath<`Self`, Tensor<Element, Device>>] { get }
-
Undocumented
Declaration
Swift
public let direction: RNNDirection
-
Undocumented
Declaration
Swift
public var Wi: Tensor<Element, Device>
-
Undocumented
Declaration
Swift
public var Wo: Tensor<Element, Device>
-
Undocumented
Declaration
Swift
public var Wf: Tensor<Element, Device>
-
Undocumented
Declaration
Swift
public var Wc: Tensor<Element, Device>
-
Undocumented
Declaration
Swift
public var Ui: Tensor<Element, Device>
-
Undocumented
Declaration
Swift
public var Uo: Tensor<Element, Device>
-
Undocumented
Declaration
Swift
public var Uf: Tensor<Element, Device>
-
Undocumented
Declaration
Swift
public var Uc: Tensor<Element, Device>
-
Undocumented
Declaration
Swift
public var bi: Tensor<Element, Device>
-
Undocumented
Declaration
Swift
public var bo: Tensor<Element, Device>
-
Undocumented
Declaration
Swift
public var bf: Tensor<Element, Device>
-
Undocumented
Declaration
Swift
public var bc: Tensor<Element, Device>
-
Undocumented
Declaration
Swift
public var inputSize: Int { get }
-
Undocumented
Declaration
Swift
public var hiddenSize: Int { get }
-
Declaration
Swift
public var parameters: [Tensor<Element, Device>] { get }
-
Creates a Long Short-Term Memory (LSTM) layer.
The RNN expects inputs to have a shape of [sequence length, batch size, input size].
Declaration
Swift
public init(inputSize: Int, hiddenSize: Int, direction: RNNDirection = .forward)
Parameters
inputSize
Number of elements at each timestep of the input
hiddenSize
Number of elements at each timestep in the output
direction
Direction, in which the RNN consumes the input sequence.
-
Declaration
Swift
public func numberOfSteps(for inputs: Tensor<Element, Device>) -> Int