Skip to main content

Crate clark_hash

Crate clark_hash 

Source
Expand description

Clark Hash: stateless sparse-JL quantization for neural embeddings.

The library centers around ClarkHash, a deterministic codec that projects an input vector into a low-dimensional sparse signed sketch and then applies a fixed scalar quantizer. The resulting code can be scored asymmetrically against floating-point queries while staying fully online and fully stateless.

The original codec and configuration names, SQuaJL and SQuaJLConfig, remain public for compatibility with earlier experiments and papers.

See the crate-level README.md for motivation, design notes, and usage examples.

Re-exports§

pub use config::SQuaJLConfig;
pub use config::SimilarityMetric;
pub use error::Result;
pub use error::SQuaJLError;
pub use index::FlatIndex;
pub use index::ScoredIndex;
pub use quantized::QuantizedVector;
pub use quantized::QuerySketch;
pub use squajl::SQuaJL;

Modules§

config
Configuration types and similarity-mode selection.
error
Error types returned by the crate.
index
A simple exact-scan index over quantized vectors.
quantized
Encoded database vectors and prepared query sketches.
squajl
The core stateless codec implementation.

Type Aliases§

ClarkHash
Package-level name for the stateless sparse-JL codec.
ClarkHashConfig
Package-level name for the codec configuration.
ClarkHashError
Package-level name for errors returned by this crate.