GRU
public struct GRU<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 Wz: Tensor<Element, Device>
-
Undocumented
Declaration
Swift
public var Wr: Tensor<Element, Device>
-
Undocumented
Declaration
Swift
public var Wh: Tensor<Element, Device>
-
Undocumented
Declaration
Swift
public var Uz: Tensor<Element, Device>
-
Undocumented
Declaration
Swift
public var Ur: Tensor<Element, Device>
-
Undocumented
Declaration
Swift
public var Uh: Tensor<Element, Device>
-
Undocumented
Declaration
Swift
public var bz: Tensor<Element, Device>
-
Undocumented
Declaration
Swift
public var br: Tensor<Element, Device>
-
Undocumented
Declaration
Swift
public var bh: Tensor<Element, Device>
-
Size of inputs of the layer
Declaration
Swift
public var inputSize: Int { get }
-
Size of outputs of the layer
Declaration
Swift
public var hiddenSize: Int { get }
-
Declaration
Swift
public var parameters: [Tensor<Element, Device>] { get }
-
Creates a Gated Recurrent Unit 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