ActivationStatistics<T>
Models & Types · AiDotNet.Deployment.Optimization.Quantization.Calibration
Holds activation statistics collected during calibration forward passes.
For Beginners
When quantizing a model, we need to know the typical range of values that flow through each layer during inference. This class stores those statistics, such as the minimum, maximum, mean, and standard deviation of activations.
How It Works
Why This Matters:
Usage: These statistics are collected by running calibration data through the model and observing the intermediate activations at each layer.
Constructors
| Constructor | Summary |
|---|---|
ActivationStatistics() |
Properties
| Property | Summary |
|---|---|
Dictionary<string, LayerActivationStats<T>> LayerStats { get; } |
Per-layer activation statistics. |
List<string> CalibrationWarnings { get; } |
Warnings generated during calibration (e.g., high failure rate). |
bool IsFromRealForwardPasses { get; set; } |
Whether the statistics were collected from actual forward passes (true) or estimated from parameter magnitudes (false). |
double[] GlobalActivationMagnitudes { get; set; } |
Global (flattened) activation magnitudes across all layers, normalized to [0,1]. |
double[] GlobalMaxAbsActivations { get; set; } |
Global maximum absolute activation values per parameter position. |
int SampleCount { get; set; } |
Number of calibration samples processed. |