fused_leader#
- nvmolkit.pickers.fused_leader(
- x,
- cutoff: float,
- *,
- metric: Literal['tanimoto', 'cosine', 'aap'] | TanimotoMetric | CosineMetric | AAPMetric = 'tanimoto',
- pick_size: int = 0,
- first_picks: Sequence[int] = (),
- stream: Stream | None = None,
- output: OutputMode = OutputMode.DEVICE,
Select leaders by sphere exclusion, computing distances as needed.
Equivalent to
leader()on the matrix of1 - similarityvalues, with memory that scales asO(N). Distances are computed in float32, so results can differ slightly from RDKit’s double-precision results.- Parameters:
x – Packed int32 or uint32 fingerprints of shape
(N, num_words)for Tanimoto and cosine, or a sequence of RDKit molecules for AAP.cutoff – Inclusive exclusion distance in
[0, 1], rounded to float32.metric – Similarity metric.
pick_size – Maximum number of leaders, or
0for no limit. Allfirst_picksare retained even if they exceed this limit.first_picks – Unique indices selected as leaders, in order, before the input-order pass.
stream – CUDA stream to use. If None, uses the current stream.
output – Result representation.
- Returns:
An
AsyncGpuResultof int32 indices forOutputMode.DEVICE, or a tuple of indices forOutputMode.RDKIT.