Skip to main content

GradientAggregator

Trait GradientAggregator 

Source
pub trait GradientAggregator {
    // Required method
    fn aggregate(
        &self,
        gradients: &[HashMap<String, Value>],
    ) -> Result<HashMap<String, Value>>;
}
Expand description

Contract for gradient aggregation across workers.

Required Methods§

Source

fn aggregate( &self, gradients: &[HashMap<String, Value>], ) -> Result<HashMap<String, Value>>

Combine per-worker gradients (keyed by node id) into the one set every worker then applies.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl GradientAggregator for GradientAggregation

Source§

fn aggregate( &self, gradients: &[HashMap<String, Value>], ) -> Result<HashMap<String, Value>>

Implementors§