SpanRepresentationScorerLayer<T>
Layers · AiDotNet.NeuralNetworks.Layers
Scores every span (start, end) of a sentence against every entity category from a span representation: the
endpoint representation of PURE or the max-pooled representation of SpERT, each with a learned width embedding.
Inheritance: LayerBase<T> → SpanRepresentationScorerLayer<T>
Implements: IShapeContract
How It Works
Shapes: input [B, S, D] (or [S, D]) token states; output [B, S * S, C], the
flattened span grid with index start * S + end, the layout of BiaffineSpanScorerLayer. Spans
with end < start are scored too (as the empty width) and are expected to be masked by the targets.
Widths above maxWidth share the last width embedding. In SpERT’s representation the first token’s
state stands in for the sentence’s [CLS] vector, since the input carries no separate classification
token.
Constructors
| Constructor | Summary |
|---|---|
SpanRepresentationScorerLayer(SpanRepresentationKind kind, int inputDim, int widthDim, int maxWidth, int hiddenDim, int numCategories) |
Creates the scorer. |
Properties
| Property | Summary |
|---|---|
bool SupportsTraining { get; } |
Methods
| Method | Summary |
|---|---|
IReadOnlyList<ILayer<T>> GetSubLayers() |
|
IReadOnlyList<OutputAxisContract> OutputAxesFor(int inputRank) |
|
void ResetState() |