ProductQuantizationMetadata<T>
Models & Types · AiDotNet.ModelCompression
Metadata for Product Quantization compression.
Implements: ICompressionMetadata<T>
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
| Constructor | Summary |
|---|---|
ProductQuantizationMetadata(T[][] codebooks, int subvectorDimension, int numSubvectors, int numCentroids, int originalLength) |
Initializes a new instance of the ProductQuantizationMetadata class. |
Properties
| Property | Summary |
|---|---|
CompressionType Type { get; } |
Gets the compression type. |
T[][] Codebooks { get; set; } |
Gets the codebooks for each subvector position. |
int NumCentroids { get; set; } |
Gets the number of centroids per codebook. |
int NumSubvectors { get; set; } |
Gets the number of subvectors. |
int OriginalLength { get; set; } |
Gets the original length of the weights array. |
int SubvectorDimension { get; set; } |
Gets the dimension of each subvector. |
Methods
| Method | Summary |
|---|---|
long GetMetadataSize() |
Gets the size in bytes of this metadata structure. |