Table of Contents

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

clusterCenters T[]

The cluster centers.

numClusters int

The number of clusters.

originalLength int

The 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

int

OriginalLength

Gets the original length of the weights array.

public int OriginalLength { get; }

Property Value

int

Type

Gets the compression type.

public CompressionType Type { get; }

Property Value

CompressionType

Methods

GetMetadataSize()

Gets the size in bytes of this metadata structure.

public long GetMetadataSize()

Returns

long