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§
Sourcefn should_add_edge(&self, gradient: f64, current_prob: f64) -> bool
fn should_add_edge(&self, gradient: f64, current_prob: f64) -> bool
决定是否添加边
Sourcefn should_remove_edge(&self, gradient: f64, current_prob: f64) -> bool
fn should_remove_edge(&self, gradient: f64, current_prob: f64) -> bool
决定是否删除边