Table of Contents

Class ProductQuantizationMetadata<T>

Namespace
AiDotNet.ModelCompression
Assembly
AiDotNet.dll

Metadata for Product Quantization compression.

public class ProductQuantizationMetadata<T> : ICompressionMetadata<T>

Type Parameters

T

The numeric type.

Inheritance
ProductQuantizationMetadata<T>
Implements
Inherited Members

Remarks

For Beginners: This metadata stores: - Codebooks: The representative values for each subvector position - Dimensions: How the original vector was divided - Original length: For proper reconstruction

Constructors

ProductQuantizationMetadata(T[][], int, int, int, int)

Initializes a new instance of the ProductQuantizationMetadata class.

public ProductQuantizationMetadata(T[][] codebooks, int subvectorDimension, int numSubvectors, int numCentroids, int originalLength)

Parameters

codebooks T[][]
subvectorDimension int
numSubvectors int
numCentroids int
originalLength int

Properties

Codebooks

Gets the codebooks for each subvector position.

public T[][] Codebooks { get; }

Property Value

T[][]

NumCentroids

Gets the number of centroids per codebook.

public int NumCentroids { get; }

Property Value

int

NumSubvectors

Gets the number of subvectors.

public int NumSubvectors { get; }

Property Value

int

OriginalLength

Gets the original length of the weights array.

public int OriginalLength { get; }

Property Value

int

SubvectorDimension

Gets the dimension of each subvector.

public int SubvectorDimension { 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