Kairos<T>
Models & Types · AiDotNet.Finance.Forecasting.Foundation
Kairos — Adaptive and Generalizable Time Series Foundation Model with Mixture-of-Size Encoder.
Inheritance: NeuralNetworkBase<T> → FinancialModelBase<T> → ForecastingModelBase<T> → TimeSeriesFoundationModelBase<T> → Kairos<T>
For Beginners
Kairos is a time series forecasting model that automatically adjusts how it reads data based on complexity. In simple, steady periods it takes big chunks at a time (like skimming a boring chapter), but in volatile periods it zooms in and reads fine details (like carefully studying a plot twist). This adaptive approach makes it both efficient and accurate across different types of data.
How It Works
Kairos uses a Mixture-of-Size Encoder that adaptively tokenizes input at multiple granularities based on local information density. A learned router decides which patch size is optimal for each segment, making the model parameter-efficient and adaptive.
Reference: “Kairos: Towards Adaptive and Generalizable Time Series Foundation Models”, 2025.
https://arxiv.org/abs/2509.25826
Example
// Create a Kairos model with Mixture-of-Size Encoder for adaptive tokenization
// Automatically adjusts patch size based on local information density
var architecture = new NeuralNetworkArchitecture<double>(
inputType: InputType.OneDimensional,
taskType: NeuralNetworkTaskType.Regression,
inputHeight: 512, inputWidth: 1, inputDepth: 1, outputSize: 24);
// Training mode with adaptive multi-granularity patching
var model = new Kairos<double>(architecture);
// ONNX inference mode with pre-trained model
var onnxModel = new Kairos<double>(architecture, "kairos.onnx");
Constructors
| Constructor | Summary |
|---|---|
Kairos(NeuralNetworkArchitecture<T> architecture, KairosOptions<T> options, IGradientBasedOptimizer<T, Tensor<T>, Tensor<T>> optimizer, ILossFunction<T> lossFunction) |
Creates a Kairos model in native mode. |
Kairos(NeuralNetworkArchitecture<T> architecture, string onnxModelPath, KairosOptions<T> options, IGradientBasedOptimizer<T, Tensor<T>, Tensor<T>> optimizer, ILossFunction<T> lossFunction) |
Creates a Kairos 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) |
|
ModelMetadata<T> GetModelMetadata() |
|
Tensor<T> ApplyInstanceNormalization(Tensor<T> input) |
|
Tensor<T> AutoregressiveForecast(Tensor<T> input, int steps) |