FastTextEmbeddingLayer<T>

Layers ยท AiDotNet.NeuralNetworks.Layers

Reusable FastText word/subword embedding front end. One shared input matrix contains word rows followed by hashed subword rows, and the parallel lookups are averaged into a bag representation.

Inheritance: LayerBase<T> โ†’ FastTextEmbeddingLayer<T>

Implements: IShapeContract

Constructors

Constructor Summary
FastTextEmbeddingLayer(int vocabularySize, int bucketSize, int embeddingDimension) Creates a word-plus-hashed-subword embedding layer.

Properties

Property Summary
EmbeddingLayer<T> FeatureEmbedding { get; } The paper-faithful shared word/subword input matrix, exposed for pretrained initialization and the string-token embedding API.
IReadOnlyList<LayerPort> InputPorts { get; } Generated from [TensorPort] declarations.
IReadOnlyList<LayerPort> OutputPorts { get; } Generated from [TensorPort] declarations.
bool SupportsTraining { get; }

Methods

Method Summary
IReadOnlyList<ILayer<T>> GetSubLayers()
IReadOnlyList<OutputAxisContract> OutputAxesFor(int inputRank)
LayerInputDomain GetInputDomain(int[] inputShape) Generated from the primary [TensorPort] declaration.
Tensor<T> LookupFeatures(Tensor<T> featureIds) Looks up already-packed word/subword feature IDs without applying bag averaging.
void ResetState()