Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
subsume
Region embeddings for entailment and set containment.
subsume represents concepts as geometric regions. A general concept contains
the regions for its more specific concepts, so containment becomes the scoring
operation for hierarchy, ontology, and set-query tasks.

(a) Containment: nested boxes encode is-a relationships. (b) Gumbel soft boundary: temperature controls membership sharpness.
Install
[]
= "0.17.1"
= "0.16"
The default features include the ndarray backend and knowledge-graph dataset
helpers. GPU training examples use Burn through burn-ndarray or burn-wgpu.
Usage
use array;
use ;
// A is the general concept.
let premise = new?;
// B is the specific concept inside A.
let hypothesis = new?;
let p = premise.containment_prob?;
assert!;
Triple convention: the head box contains the tail box. For datasets where
triples are (child, hypernym, parent), pass reverse=True to the Python
loader or reverse the triples before training.
Training
use Path;
use ;
let dataset = load_dataset?;
let interned = dataset.into_interned;
let train: = interned.train.iter.map.collect;
let config = TrainingConfig ;
let mut trainer = new;
let result = trainer.fit?;
println!;
Python bindings are published as subsumer:
See subsume-python/README.md for Python examples.
Choosing A Geometry
| Task | Start with | Notes |
|---|---|---|
| Containment hierarchy | NdarrayBox or NdarrayGumbelBox |
Boxes have volume and intersection; Gumbel boxes give dense gradients |
| Logical queries with negation | Cone or subspace | Cones and subspaces support complement-like operations |
| Taxonomy expansion with uncertainty | Gaussian boxes | KL gives asymmetric containment; Bhattacharyya gives overlap |
| EL++ ontology completion | el, transbox |
Uses axiom losses rather than plain triple scoring |
| Tree-like hierarchies in low dimension | Hyperbolic intervals or balls | Useful when depth is the main structure |
The full geometry table is in docs/geometries.md.
Scores are monotone within a geometry but not calibrated across geometries; see
cargo run --example region_generic.
Why Regions
Point embeddings such as TransE, RotatE, and ComplEx work well for ordinary link prediction. Regions are useful when the task needs structure that points do not have:
| Need | Point embeddings | Region embeddings |
|---|---|---|
| Containment | No interior | Box nesting |
| Generality | No volume | Larger region = broader concept |
| Intersection | No set operation | Box intersection |
| Negation | No complement | Cone or subspace complement |
| Uncertainty | Extra model-specific machinery | Region size or Gaussian variance |
For background, see Why Regions, Not Points
and docs/SUBSUMPTION_HISTORY.md.
Examples
The full example map is in examples/README.md.
Benchmarks
EL++ ontology completion results and reproduction commands are in
docs/benchmarks.md. The current strongest results are on
NF3 existential restrictions, with MRR 0.21-0.37 across GALEN, GO, and Anatomy in
the recorded single-run Burn benchmark.
Limits
- For ordinary link prediction, point embeddings are often simpler.
- Region scores from different geometries are not directly comparable.
- Several geometry trainers are research paths, not recommended defaults.
- GPU examples depend on Burn backend features and dataset files under
data/.
Documentation
License
MIT OR Apache-2.0