pub struct CoOccurrenceIndex { /* private fields */ }Expand description
Co-occurrence embeddings built from short random walks on the graph.
Implementations§
Source§impl CoOccurrenceIndex
impl CoOccurrenceIndex
Sourcepub fn build(
graph: &Graph,
walk_length: usize,
walks_per_node: usize,
window_size: usize,
) -> M1ndResult<Self>
pub fn build( graph: &Graph, walk_length: usize, walks_per_node: usize, window_size: usize, ) -> M1ndResult<Self>
Build co-occurrence embeddings from random walks. Replaces: semantic_v2.py CoOccurrenceEmbedder.build() FM-SEM-004: memory warning logged if node_count > 10_000.
Sourcepub fn cosine_similarity(
a: &CoOccurrenceVector,
b: &CoOccurrenceVector,
) -> FiniteF32
pub fn cosine_similarity( a: &CoOccurrenceVector, b: &CoOccurrenceVector, ) -> FiniteF32
Cosine similarity between two sorted co-occurrence vectors. Uses merge-intersection on sorted vectors for O(D) instead of O(D^2).
Auto Trait Implementations§
impl Freeze for CoOccurrenceIndex
impl RefUnwindSafe for CoOccurrenceIndex
impl Send for CoOccurrenceIndex
impl Sync for CoOccurrenceIndex
impl Unpin for CoOccurrenceIndex
impl UnsafeUnpin for CoOccurrenceIndex
impl UnwindSafe for CoOccurrenceIndex
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