Class SparsePruningMetadata<T>
- Namespace
- AiDotNet.ModelCompression
- Assembly
- AiDotNet.dll
Metadata for sparse pruning compression.
public class SparsePruningMetadata<T> : ICompressionMetadata<T>
Type Parameters
TThe numeric type.
- Inheritance
-
SparsePruningMetadata<T>
- Implements
- Inherited Members
Remarks
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
SparsePruningMetadata(int[], int, double, double)
Initializes a new instance of the SparsePruningMetadata class.
public SparsePruningMetadata(int[] nonZeroIndices, int originalLength, double threshold, double actualSparsity)
Parameters
Properties
ActualSparsity
Gets the actual sparsity achieved (fraction of zeros).
public double ActualSparsity { get; }
Property Value
NonZeroIndices
Gets the indices of non-zero values.
public int[] NonZeroIndices { get; }
Property Value
- int[]
OriginalLength
Gets the original length of the weights array.
public int OriginalLength { get; }
Property Value
Threshold
Gets the threshold used for pruning.
public double Threshold { get; }
Property Value
Type
Gets the compression type.
public CompressionType Type { get; }
Property Value
Methods
GetMetadataSize()
Gets the size in bytes of this metadata structure.
public long GetMetadataSize()