HuffmanEncodingMetadata<T>
Models & Types · AiDotNet.ModelCompression
Metadata for Huffman encoding compression.
Implements: ICompressionMetadata<T>
For Beginners
This metadata stores the information needed to decompress Huffman-encoded weights:
- The Huffman tree (for decoding variable-length codes back to values)
- The encoding table (mapping values to their codes, used during compression)
- The original length and bit length (for proper reconstruction)
Huffman encoding is lossless - you get exactly the original values back when decompressing.
Constructors
| Constructor | Summary |
|---|---|
HuffmanEncodingMetadata(HuffmanNode<T> huffmanTree, NumericDictionary<T, string> encodingTable, int originalLength, int bitLength) |
Initializes a new instance of the HuffmanEncodingMetadata class. |
Properties
| Property | Summary |
|---|---|
CompressionType Type { get; } |
Gets the compression type. |
HuffmanNode<T> HuffmanTree { get; set; } |
Gets the Huffman tree used for encoding. |
NumericDictionary<T, string> EncodingTable { get; set; } |
Gets the encoding table mapping values to codes. |
int BitLength { get; set; } |
Gets the length of the encoded bit stream. |
int OriginalLength { get; set; } |
Gets the original length of the weights vector. |
Methods
| Method | Summary |
|---|---|
long GetMetadataSize() |
Gets the size in bytes of this metadata structure. |