Class WeightClusteringMetadata<T>
- Namespace
- AiDotNet.ModelCompression
- Assembly
- AiDotNet.dll
Metadata for weight clustering compression.
public class WeightClusteringMetadata<T> : ICompressionMetadata<T>
Type Parameters
T
- Inheritance
-
WeightClusteringMetadata<T>
- Implements
- Inherited Members
Remarks
For Beginners: This metadata stores the information needed to decompress clustered weights: - The cluster centers (the actual weight values each cluster represents) - The number of clusters used - The original number of weights
When decompressing, each cluster index is replaced with its corresponding cluster center value.
Constructors
WeightClusteringMetadata(T[], int, int)
Initializes a new instance of the WeightClusteringMetadata class.
public WeightClusteringMetadata(T[] clusterCenters, int numClusters, int originalLength)
Parameters
clusterCentersT[]The cluster centers.
numClustersintThe number of clusters.
originalLengthintThe original length of the weights array.
Properties
ClusterCenters
Gets the cluster centers.
public T[] ClusterCenters { get; }
Property Value
- T[]
NumClusters
Gets the number of clusters.
public int NumClusters { get; }
Property Value
OriginalLength
Gets the original length of the weights array.
public int OriginalLength { 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()