TabTransformerGenGenerator<T>
Models & Types · AiDotNet.NeuralNetworks.SyntheticData
TabTransformer-Gen generator that uses column-wise contextual embeddings and masked prediction to generate realistic tabular data.
Inheritance: NeuralNetworkBase<T> → NeuralSyntheticTabularGeneratorBase<T> → TabTransformerGenGenerator<T>
Implements: ISyntheticTabularGenerator<T>
For Beginners
Think of this like a crossword puzzle:
- Each column is a clue that helps fill in other columns
- During training, we hide some columns and learn to fill them in
- During generation, we start with an empty puzzle and fill in one column at a time,
using already-filled columns as context for the remaining ones
If you provide custom layers in the architecture, those will be used for the feed-forward network blocks. If not, the network creates standard TabTransformer layers based on the original paper specifications.
Example usage:
How It Works
TabTransformer-Gen treats each column as a “token” in a sequence:
Training: Mask random columns, predict their values from the unmasked context. Generation: Start with all columns masked, iteratively unmask (predict) columns.
This implementation follows the standard neural network architecture pattern with:
- Proper inheritance from NeuralNetworkBase
- Layer-based architecture using ILayer components
- Full forward/backward/update lifecycle
Reference: “TabTransformer: Tabular Data Modeling Using Contextual Embeddings” (Huang et al., 2020) — adapted for generation with masked prediction
Constructors
| Constructor | Summary |
|---|---|
TabTransformerGenGenerator() |
Initializes a new TabTransformer-Gen generator with the specified architecture. |
TabTransformerGenGenerator(NeuralNetworkArchitecture<T> architecture, TabTransformerGenOptions<T> options, IGradientBasedOptimizer<T, Tensor<T>, Tensor<T>> optimizer, ILossFunction<T> lossFunction) |
Properties
| Property | Summary |
|---|---|
IReadOnlyList<ColumnMetadata> Columns { get; } |
|
TabTransformerGenOptions<T> TransformerOptions { get; } |
Gets the TabTransformerGen-specific options. |
bool IsFitted { get; set; } |
Methods
| Method | Summary |
|---|---|
Dictionary<string, T> GetFeatureImportance() |
|
Matrix<T> Generate(int numSamples, Vector<T> conditionColumn, Vector<T> conditionValue) |
|
ModelMetadata<T> GetModelMetadata() |
|
Task FitAsync(Matrix<T> data, IReadOnlyList<ColumnMetadata> columns, int? epochs, CancellationToken ct) |
|
Tensor<T> ForwardForTraining(Tensor<T> input) |
The training forward — identical to Predict — overridden so the tape-based training path runs the column-token transformer rather than the default sequential walk over Layers (which would feed each layer’s output to the next, ignoring t… |
void Fit(Matrix<T> data, IReadOnlyList<ColumnMetadata> columns, int? epochs) |