Skip to main content

ClarkHashConfig

Type Alias ClarkHashConfig 

Source
pub type ClarkHashConfig = SQuaJLConfig;
Expand description

Package-level name for the codec configuration.

Aliased Type§

pub struct ClarkHashConfig {
    pub input_dim: usize,
    pub sketch_dim: usize,
    pub bits: u8,
    pub hashes_per_input: u8,
    pub clip: f32,
    pub seed: u64,
    pub metric: SimilarityMetric,
    pub norm_log2_min: f32,
    pub norm_log2_max: f32,
}

Fields§

§input_dim: usize

Input embedding dimension.

§sketch_dim: usize

Output sketch dimension.

Larger values usually improve recall at the cost of more memory.

§bits: u8

Number of bits per quantized coordinate.

Supported range: 1..=8.

§hashes_per_input: u8

Number of non-zero sketch updates per input coordinate.

Larger values reduce projection noise but cost more CPU at encode time.

§clip: f32

Symmetric clip range for the scaled sketch.

Coordinates are clipped to [-clip, clip] before scalar quantization.

§seed: u64

Global seed used to derive sparse bucket locations and signs.

§metric: SimilarityMetric

Similarity objective for scoring.

§norm_log2_min: f32

Lower bound for log2(norm) when the norm channel is enabled.

§norm_log2_max: f32

Upper bound for log2(norm) when the norm channel is enabled.