Array quantization and compression.
Pkg.add("QuantizedArrays")
- Vector quantization
using QuantizedArrays
v = collect(1:10);
# Use 3 quantization levels (always 1 codebook)
qv = QuantizedArray(v, k=3)
# 10-element QuantizedArray{QuantizedArrays.OrthogonalQuantization,UInt8,Distances.SqEuclidean,Int64,1}:
# 5
# 5
# 5
# 5
# 5
# 6
# 6
# 6
# 10
# 10
- matrix quantization
using QuantizedArrays
m = reshape(collect(1:60), (6,10))
# 6×10 array{int64,2}:
# 1 7 13 19 25 31 37 43 49 55
# 2 8 14 20 26 32 38 44 50 56
# 3 9 15 21 27 33 39 45 51 57
# 4 10 16 22 28 34 40 46 52 58
# 5 11 17 23 29 35 41 47 53 59
# 6 12 18 24 30 36 42 48 54 60
# use 5 quantization levels (vectors) / codebook and 2 codebooks
qm = QuantizedArray(m, k = 5, m = 2)
# 6×10 QuantizedArray{QuantizedArrays.OrthogonalQuantization,UInt8,Distances.SqEuclidean,Int64,2}:
# 7 7 13 13 31 31 43 43 43 55
# 8 8 14 14 32 32 44 44 44 56
# 9 9 15 15 33 33 45 45 45 57
# 10 10 10 28 28 34 40 46 46 46
# 11 11 11 29 29 35 41 47 47 47
# 12 12 12 30 30 36 42 48 48 48
To keep track with the latest features, please consult NEWS.md and the documentation.
The code has an MIT license and therefore it is free.
This is work in progress and bugs may still be present...¯\(ツ)/¯ Do not worry, just open an issue to report a bug or request a feature.
-
Rayuela.jl provides an extensive list of quantization methods implementations as well as good references pertinent to the state-of-the-art.