FinDiffGenerator<T>
Models & Types · AiDotNet.NeuralNetworks.SyntheticData
FinDiff generator for synthesizing realistic financial tabular data using diffusion models with temporal correlation preservation and financial constraint enforcement.
Inheritance: NeuralNetworkBase<T> → NeuralSyntheticTabularGeneratorBase<T> → FinDiffGenerator<T>
Implements: ISyntheticTabularGenerator<T>
For Beginners
FinDiff generates fake financial data that respects financial rules:
- Stock prices don’t jump randomly — they follow trends (temporal correlation)
- Prices are always positive (constraint enforcement)
- Volatile periods cluster together (volatility awareness)
If you provide custom layers in the architecture, those will be used directly for the denoiser MLP. If not, the network creates industry-standard FinDiff layers based on the original research paper specifications.
Example usage:
How It Works
FinDiff augments standard diffusion with financial-specific losses:
This implementation follows the standard neural network architecture pattern with:
- Proper inheritance from NeuralNetworkBase
- Layer-based architecture using ILayer components
- Engine-based tensor operations for CPU/GPU acceleration
- Full autodiff and JIT compilation support
Reference: “Diffusion Models for Financial Tabular Data” (2024)
Constructors
| Constructor | Summary |
|---|---|
FinDiffGenerator() |
Initializes a new FinDiff generator with the specified architecture. |
FinDiffGenerator(NeuralNetworkArchitecture<T> architecture, FinDiffOptions<T> options, IGradientBasedOptimizer<T, Tensor<T>, Tensor<T>> optimizer, ILossFunction<T> lossFunction) |
Properties
| Property | Summary |
|---|---|
FinDiffOptions<T> Options { get; } |
Gets the FinDiff-specific options. |
IReadOnlyList<ColumnMetadata> Columns { get; } |
|
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) |
|
void Fit(Matrix<T> data, IReadOnlyList<ColumnMetadata> columns, int? epochs) |