DocumentNeuralNetworkOptions
Options & Configuration · AiDotNet.Models.Options
Shared configuration for document models: OCR and text recognition, layout analysis, document question answering, table and chart understanding, and document VQA.
Inheritance: ModelOptions → NeuralNetworkOptions → ModelHyperparameterOptions → DocumentNeuralNetworkOptions
Known derived types: ABINetOptions, DessurtOptions, DiTOptions, DocBankOptions, DocFormerOptions, DocGCNOptions, DocOwlOptions, DonutOptions, InfographicVQAOptions, LayoutGraphOptions, LayoutLMOptions, LayoutLMv2Options, LayoutLMv3Options, LayoutXLMOptions, LiLTOptions, MATCHAOptions, NougatOptions, PICKOptions, PSENetOptions, Pix2StructOptions, SVTROptions, TRIEOptions, TableTransformerOptions, UDOPOptions
For Beginners
Document models read scanned pages and photographs of documents. They need to know how large the page image is, how much text they can produce, and how big their internal representations are. Each model’s own options class ships the values from the paper that introduced it, so you do not normally set any of these.
How It Works
Derived options classes assign their paper’s values in their parameterless constructor:
See ModelHyperparameterOptions for why these properties are non-nullable.
This class already sits at the root of every options class under
src/Document/Options — all 29 of them derive from it — so adding the shared
knobs here reaches the whole area without touching the leaves.
Not to be confused with DocumentModelOptions<T>, an earlier and now
abandoned attempt at the same idea: it takes a type parameter it never uses, follows the
nullable + Effective* pattern this design moves away from, and nothing derives
from it. It is left in place for now and removed when the document models are wired.
Constructors
| Constructor | Summary |
|---|---|
DocumentNeuralNetworkOptions() |
Initializes the shared document settings with their defaults. |
DocumentNeuralNetworkOptions(DocumentNeuralNetworkOptions other) |
Copies every shared document setting and inherited model setting. |
Properties
| Property | Summary |
|---|---|
int BackboneChannels { get; set; } |
Gets or sets the channel width of the convolutional backbone, for detection-style models such as text detectors. |
int HiddenDim { get; set; } |
Gets or sets the width of the model’s main hidden representation. |
int ImageHeight { get; set; } |
Gets or sets the input image height in pixels, for models that expect a non-square page. |
int ImageSize { get; set; } |
Gets or sets the side length, in pixels, of the page image the model expects. |
int ImageWidth { get; set; } |
Gets or sets the input image width in pixels, for models that expect a non-square page. |
int MaxSequenceLength { get; set; } |
Gets or sets the longest sequence, in tokens, the model reads or produces. |
int NumClasses { get; set; } |
Gets or sets the number of output categories, for classification models. |
int NumDecoderLayers { get; set; } |
Gets or sets the number of decoder layers, for encoder-decoder models. |
int NumEncoderLayers { get; set; } |
Gets or sets the number of encoder layers, for encoder-decoder models. |
int NumHeads { get; set; } |
Gets or sets the number of attention heads. |
int NumLayers { get; set; } |
Gets or sets the total number of stacked blocks, for models with a single stack. |
int PatchSize { get; set; } |
Gets or sets the side length, in pixels, of each square patch the page is divided into. |
int VisionDim { get; set; } |
Gets or sets the width of the vision tower’s hidden representation. |
int VisionLayers { get; set; } |
Gets or sets the number of layers in the vision tower. |
int VocabSize { get; set; } |
Gets or sets the number of distinct tokens the model’s tokenizer covers. |