TransformerDecoder
public struct TransformerDecoder<Element, Device> : LayerType, Codable where Element : RandomizableType, Device : DeviceType
Transformer encoder sequencing positional encoding and token embedding and multiple transformer encoder layers, as introduced by Attention Is All You Need.
-
Undocumented
Declaration
Swift
public var decoderLayers: [TransformerDecoderBlock<Element, Device>]
-
Declaration
Swift
public var parameters: [Tensor<Element, Device>] { get }
-
Declaration
Swift
public var parameterPaths: [WritableKeyPath<`Self`, Tensor<Element, Device>>] { get }
-
Creates aransformer encoder sequencing positional encoding and token embedding and multiple transformer encoder layers, as introduced by Attention Is All You Need.
Declaration
Swift
public init(layerCount: Int, heads: Int, keyDim: Int, valueDim: Int, modelDim: Int, forwardDim: Int, dropout: Float)