SparsePruningMetadata<T>

Models & Types · AiDotNet.ModelCompression

Metadata for sparse pruning compression.

Implements: ICompressionMetadata<T>

For Beginners

This metadata stores:

  • Indices of non-zero values (so we know where to put them during decompression)
  • Original vector length (to reconstruct the right size)
  • Threshold used (for reference)
  • Actual sparsity achieved (for statistics)

Constructors

Constructor Summary
SparsePruningMetadata(int[] nonZeroIndices, int originalLength, double threshold, double actualSparsity) Initializes a new instance of the SparsePruningMetadata class.

Properties

Property Summary
CompressionType Type { get; } Gets the compression type.
double ActualSparsity { get; set; } Gets the actual sparsity achieved (fraction of zeros).
double Threshold { get; set; } Gets the threshold used for pruning.
int OriginalLength { get; set; } Gets the original length of the weights array.
int[] NonZeroIndices { get; set; } Gets the indices of non-zero values.

Methods

Method Summary
long GetMetadataSize() Gets the size in bytes of this metadata structure.