pub struct BoxEmbedding {
pub min: Vec<f32>,
pub max: Vec<f32>,
pub temperature: Option<f32>,
}Expand description
Box embedding for geometric coreference resolution.
Uses axis-aligned hyperrectangles to encode logical invariants. This is based on research showing that box embeddings can capture containment relationships better than vector embeddings.
§Status: Experimental
This type may change significantly. The current representation uses
serde_json::Value as a placeholder; a proper typed representation
will be added once the embedding format stabilizes.
§References
- Vilnis et al., “Probabilistic Embedding of Knowledge Graphs with Box Lattice Measures”
- Dasgupta et al., “Improving Local Identifiability in Probabilistic Box Embeddings”
Fields§
§min: Vec<f32>Minimum corner of the box (lower bounds).
max: Vec<f32>Maximum corner of the box (upper bounds).
temperature: Option<f32>Temperature parameter for softbox formulation.
Implementations§
Source§impl BoxEmbedding
impl BoxEmbedding
Sourcepub fn contains_point(&self, point: &[f32]) -> bool
pub fn contains_point(&self, point: &[f32]) -> bool
Check if this box contains a point.
Sourcepub fn contains_box(&self, other: &BoxEmbedding) -> bool
pub fn contains_box(&self, other: &BoxEmbedding) -> bool
Check if this box contains another box.
Sourcepub fn intersection_volume(&self, other: &BoxEmbedding) -> f32
pub fn intersection_volume(&self, other: &BoxEmbedding) -> f32
Compute intersection volume with another box.
Trait Implementations§
Source§impl Clone for BoxEmbedding
impl Clone for BoxEmbedding
Source§fn clone(&self) -> BoxEmbedding
fn clone(&self) -> BoxEmbedding
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BoxEmbedding
impl Debug for BoxEmbedding
Source§impl Default for BoxEmbedding
impl Default for BoxEmbedding
Source§fn default() -> BoxEmbedding
fn default() -> BoxEmbedding
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for BoxEmbedding
impl<'de> Deserialize<'de> for BoxEmbedding
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for BoxEmbedding
impl PartialEq for BoxEmbedding
Source§impl Serialize for BoxEmbedding
impl Serialize for BoxEmbedding
impl StructuralPartialEq for BoxEmbedding
Auto Trait Implementations§
impl Freeze for BoxEmbedding
impl RefUnwindSafe for BoxEmbedding
impl Send for BoxEmbedding
impl Sync for BoxEmbedding
impl Unpin for BoxEmbedding
impl UnsafeUnpin for BoxEmbedding
impl UnwindSafe for BoxEmbedding
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more