fused_dise#
- nvmolkit.clustering.fused_dise(
- x,
- cutoff: float,
- *,
- metric: Literal['tanimoto', 'cosine', 'aap'] | TanimotoMetric | CosineMetric | AAPMetric = 'tanimoto',
- assignment: Literal['first', 'nearest'] = 'nearest',
- stream: Stream | None = None,
- output: OutputMode = OutputMode.DEVICE,
Cluster by directed sphere exclusion (DISE), computing distances as needed.
Equivalent to
dise()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.
assignment –
"first"or"nearest".stream – CUDA stream to use. If None, uses the current stream.
output – Result representation.
- Returns:
A
ClusterDeviceResultforOutputMode.DEVICE, or centroid-first tuples of input indices forOutputMode.RDKIT.
Note
For the method, see Gobbi et al. (2015).