YingLong<T>

Models & Types · AiDotNet.Finance.Forecasting.Foundation

YingLong — Alibaba’s Enterprise Time Series Foundation Model.

Inheritance: NeuralNetworkBase<T> → FinancialModelBase<T> → ForecastingModelBase<T> → TimeSeriesFoundationModelBase<T> → YingLong<T>

For Beginners

YingLong is Alibaba’s general-purpose time series forecasting model, pre-trained on massive amounts of data from Alibaba’s cloud infrastructure. It is designed to handle enterprise-scale workloads like demand forecasting, capacity planning, and resource allocation. Think of it as a forecasting model that has already learned from one of the largest e-commerce and cloud platforms in the world.

How It Works

YingLong is Alibaba’s transformer-based time series foundation model designed for general-purpose forecasting with a focus on cloud and enterprise workloads. Pre-trained on large-scale data from Alibaba’s data infrastructure.

Example

// Create a YingLong model (Alibaba) for enterprise time series forecasting
// Pre-trained on massive data from Alibaba's cloud and e-commerce infrastructure
var architecture = new NeuralNetworkArchitecture<double>(
    inputType: InputType.OneDimensional,
    taskType: NeuralNetworkTaskType.Regression,
    inputHeight: 512, inputWidth: 1, inputDepth: 1, outputSize: 24);
            
// Training mode with transformer backbone for enterprise workloads
var model = new YingLong<double>(architecture);
            
// ONNX inference mode with pre-trained model
var onnxModel = new YingLong<double>(architecture, "yinglong.onnx");

Constructors

Constructor Summary
YingLong(NeuralNetworkArchitecture<T> architecture, YingLongOptions<T> options, IGradientBasedOptimizer<T, Tensor<T>, Tensor<T>> optimizer, ILossFunction<T> lossFunction) Creates a YingLong model in native mode for training or fine-tuning.
YingLong(NeuralNetworkArchitecture<T> architecture, string onnxModelPath, YingLongOptions<T> options, IGradientBasedOptimizer<T, Tensor<T>, Tensor<T>> optimizer, ILossFunction<T> lossFunction) Creates a YingLong model using a pretrained ONNX model.

Properties

Property Summary
FoundationModelSize ModelSize { get; }
bool IsChannelIndependent { get; }
bool SupportsTraining { get; }
bool UseNativeMode { get; }
int MaxContextLength { get; }
int MaxPredictionHorizon { get; }
int NumFeatures { get; }
int PatchSize { get; }
int PredictionHorizon { get; }
int SequenceLength { get; }
int Stride { get; }

Methods

Method Summary
Dictionary<string, T> Evaluate(Tensor<T> predictions, Tensor<T> actuals)
Dictionary<string, T> GetFinancialMetrics()
Dictionary<string, Tensor<T>> GetNamedLayerActivations(Tensor<T> input) Captures per-layer activations of the native forward pass.
ModelMetadata<T> GetModelMetadata()
Tensor<T> ApplyInstanceNormalization(Tensor<T> input)
Tensor<T> AutoregressiveForecast(Tensor<T> input, int steps)