SVTRThinPlateSplineLayer<T>

Layers · AiDotNet.NeuralNetworks.Layers

SVTR’s trainable STN_ON rectifier: a six-block localization CNN predicts control points and a thin-plate-spline grid resamples the source image to 32x100.

Inheritance: LayerBase<T> → SVTRThinPlateSplineLayer<T>

Implements: IShapeContract

For Beginners

The localization network predicts how curved or tilted text should be straightened, then a smooth thin-plate-spline warp resamples it into the fixed canvas that the recognizer expects.

How It Works

Reference: Du et al., “SVTR: Scene Text Recognition with a Single Visual Model”, IJCAI 2022 (STN_ON), and Jaderberg et al., “Spatial Transformer Networks”, NeurIPS 2015.

Constructors

Constructor Summary
SVTRThinPlateSplineLayer(int inputChannels, int localizationHeight, int localizationWidth, int outputHeight, int outputWidth, int controlPointCount, double marginX, double marginY, double localizationMargin)

Properties

Property Summary
bool SupportsTraining { get; }
double MarginX { get; }
double MarginY { get; }
int ControlPointCount { get; }
int LocalizationHeight { get; }
int LocalizationWidth { get; }
int OutputHeight { get; }
int OutputWidth { get; }

Methods

Method Summary
Dictionary<string, string> GetParameterRoles() Returns parameter roles for per-role optimizer configuration (e.g., weight decay exemption for biases).
IReadOnlyList<ILayer<T>> GetSubLayers()
IReadOnlyList<OutputAxisContract> OutputAxesFor(int inputRank)
IReadOnlyList<Tensor<T>> GetTrainableParameters() Returns all trainable parameter tensors marked with [TrainableParameter].
IReadOnlyList<ValueTuple<string, Tensor<T>>> GetRegisteredBuffers()
void ResetState()
void SetTrainableParameters(IReadOnlyList<Tensor<T>> parameters) Replaces trainable parameter tensors (e.g., with ParameterBuffer views).
void ZeroGrad() Clears all gradient fields discovered by convention ({paramName}Gradient).