Class ProductQuantizationMetadata<T>
- Namespace
- AiDotNet.ModelCompression
- Assembly
- AiDotNet.dll
Metadata for Product Quantization compression.
public class ProductQuantizationMetadata<T> : ICompressionMetadata<T>
Type Parameters
TThe 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
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
NumSubvectors
Gets the number of subvectors.
public int NumSubvectors { get; }
Property Value
OriginalLength
Gets the original length of the weights array.
public int OriginalLength { get; }
Property Value
SubvectorDimension
Gets the dimension of each subvector.
public int SubvectorDimension { 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()