Skip to main content

EdgeEditPolicy

Trait EdgeEditPolicy 

Source
pub trait EdgeEditPolicy: Send + Sync {
    // Required methods
    fn should_add_edge(&self, gradient: f64, current_prob: f64) -> bool;
    fn should_remove_edge(&self, gradient: f64, current_prob: f64) -> bool;
    fn update_probability(
        &self,
        current_prob: f64,
        gradient: f64,
        learning_rate: f64,
    ) -> f64;
}
Expand description

边编辑策略:定义如何基于梯度编辑边

Required Methods§

Source

fn should_add_edge(&self, gradient: f64, current_prob: f64) -> bool

决定是否添加边

Source

fn should_remove_edge(&self, gradient: f64, current_prob: f64) -> bool

决定是否删除边

Source

fn update_probability( &self, current_prob: f64, gradient: f64, learning_rate: f64, ) -> f64

计算新的边概率

Implementors§