pub struct DynamicGraphLearning {
pub learning_rate: f64,
pub forgetting_factor: f64,
pub k_neighbors: usize,
pub buffer_size: usize,
pub edge_threshold: f64,
pub max_nodes: Option<usize>,
pub random_state: Option<u64>,
/* private fields */
}Expand description
Dynamic graph learning for streaming and continuously evolving scenarios
Fields§
§learning_rate: f64Learning rate for online updates
forgetting_factor: f64Forgetting factor for old connections
k_neighbors: usizeNumber of neighbors for new node integration
buffer_size: usizeBuffer size for streaming updates
edge_threshold: f64Threshold for edge creation/removal
max_nodes: Option<usize>Maximum number of nodes to maintain
random_state: Option<u64>Random state for reproducibility
Implementations§
Source§impl DynamicGraphLearning
impl DynamicGraphLearning
Sourcepub fn learning_rate(self, lr: f64) -> Self
pub fn learning_rate(self, lr: f64) -> Self
Set the learning rate for online updates
Sourcepub fn forgetting_factor(self, factor: f64) -> Self
pub fn forgetting_factor(self, factor: f64) -> Self
Set the forgetting factor for old connections
Sourcepub fn k_neighbors(self, k: usize) -> Self
pub fn k_neighbors(self, k: usize) -> Self
Set the number of neighbors for new node integration
Sourcepub fn buffer_size(self, size: usize) -> Self
pub fn buffer_size(self, size: usize) -> Self
Set the buffer size for streaming updates
Sourcepub fn edge_threshold(self, threshold: f64) -> Self
pub fn edge_threshold(self, threshold: f64) -> Self
Set the edge threshold for creation/removal
Sourcepub fn random_state(self, seed: u64) -> Self
pub fn random_state(self, seed: u64) -> Self
Set the random state for reproducibility
Sourcepub fn initialize(
&mut self,
initial_features: ArrayView2<'_, f64>,
) -> Result<(), SklearsError>
pub fn initialize( &mut self, initial_features: ArrayView2<'_, f64>, ) -> Result<(), SklearsError>
Initialize the dynamic graph with initial data
Sourcepub fn add_nodes(
&mut self,
new_features: ArrayView2<'_, f64>,
) -> Result<(), SklearsError>
pub fn add_nodes( &mut self, new_features: ArrayView2<'_, f64>, ) -> Result<(), SklearsError>
Add new nodes to the dynamic graph
Sourcepub fn update_node_features(
&mut self,
node_idx: usize,
new_features: ArrayView1<'_, f64>,
) -> Result<(), SklearsError>
pub fn update_node_features( &mut self, node_idx: usize, new_features: ArrayView1<'_, f64>, ) -> Result<(), SklearsError>
Update node features dynamically
Sourcepub fn get_adjacency_matrix(&self) -> Option<&Array2<f64>>
pub fn get_adjacency_matrix(&self) -> Option<&Array2<f64>>
Get the current adjacency matrix
Sourcepub fn get_node_features(&self) -> Option<&Array2<f64>>
pub fn get_node_features(&self) -> Option<&Array2<f64>>
Get the current node features
Sourcepub fn get_recent_updates(&self, n_updates: usize) -> Vec<&GraphUpdate>
pub fn get_recent_updates(&self, n_updates: usize) -> Vec<&GraphUpdate>
Get recent updates from the buffer
Sourcepub fn apply_temporal_decay(&mut self) -> Result<(), SklearsError>
pub fn apply_temporal_decay(&mut self) -> Result<(), SklearsError>
Apply decay to all edges to simulate forgetting
Sourcepub fn get_statistics(&self) -> HashMap<String, f64>
pub fn get_statistics(&self) -> HashMap<String, f64>
Get graph statistics
Trait Implementations§
Source§impl Clone for DynamicGraphLearning
impl Clone for DynamicGraphLearning
Source§fn clone(&self) -> DynamicGraphLearning
fn clone(&self) -> DynamicGraphLearning
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for DynamicGraphLearning
impl RefUnwindSafe for DynamicGraphLearning
impl Send for DynamicGraphLearning
impl Sync for DynamicGraphLearning
impl Unpin for DynamicGraphLearning
impl UnwindSafe for DynamicGraphLearning
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more