-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
una-dinosauria
committed
Oct 14, 2018
1 parent
eb97eab
commit bd90a7d
Showing
9 changed files
with
94 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,8 @@ makedocs( | |
"OPQ.md", | ||
"RVQ.md", | ||
"ERVQ.md", | ||
"ChainQ.md" | ||
"ChainQ.md", | ||
"LSQ.md" | ||
] | ||
] | ||
# doctest = test | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,3 +33,4 @@ nav: | |
- RVQ.html | ||
- ERVQ.html | ||
- ChainQ.html | ||
- LSQ.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Local search quantization (LSQ) | ||
|
||
Local search quantization (LSQ) is an non-orthogonal MCQ method. | ||
|
||
LSQ uses fully dimensional codebooks. Codebook update is done via least squares, and encoding is done with | ||
iterated local search (ILS), using randomized iterated conditional modes (ICM) as a local search subroutine. | ||
|
||
```@docs | ||
encoding_icm | ||
train_lsq | ||
``` | ||
|
||
## Reference | ||
|
||
Martinez, J., Clement, J., Hoos, H. H., & Little, J. J. (2016). Revisiting additive quantization. In _European Conference on Computer Vision_ (pp. 137-153). Springer, Cham. [[PDF](https://www.cs.ubc.ca/~julm/papers/eccv16.pdf)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
|
||
|
||
# Make sure the fast version of codebook update is still okay | ||
@testset "Chain codebook update" begin | ||
d, n, m, h, V, rho = 32, 10_000, 4, 256, false, 1e-4 | ||
X, _, B = generate_random_dataset(Float64, Int16, d, n, m, h) | ||
|
||
# These two methods are equivalent, but the second should be faster | ||
C1, _ = Rayuela.update_codebooks_chain(X, B, h, V) | ||
C2, _ = Rayuela.update_codebooks_chain_bin(X, B, h, V, rho) | ||
@test isapprox(C1, C2) | ||
end | ||
|
||
|
||
# Chain quantization | ||
@testset "Chain encoding" begin | ||
d, n, m, h = 32, Int(1e3), 4, 256 | ||
X, C, B = generate_random_dataset(Float32, Int16, d, n, m, h) | ||
|
||
B1, _ = Rayuela.quantize_chainq(X, C) # Julia | ||
|
||
use_cuda, use_cpp = true, false | ||
B2, _ = Rayuela.quantize_chainq(X, C, use_cuda, use_cpp) # Cuda | ||
|
||
use_cuda, use_cpp = false, true | ||
B3, _ = Rayuela.quantize_chainq(X, C, use_cuda, use_cpp) # C++ | ||
@test all(B1 .== B2 .== B3) # C++ implememtation | ||
end |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters