pub struct WorkerNode {
pub id: NodeId,
pub data_partition: DataPartition,
pub local_parameters: Vec<f64>,
pub parameter_version: usize,
pub stats: WorkerStats,
}Expand description
Worker node for distributed computation
Fields§
§id: NodeIdNode identifier
data_partition: DataPartitionLocal data partition
local_parameters: Vec<f64>Local model parameters (cached from parameter server)
parameter_version: usizeParameter version
stats: WorkerStatsWorker statistics
Implementations§
Source§impl WorkerNode
impl WorkerNode
Sourcepub fn new(id: NodeId, data_partition: DataPartition) -> Self
pub fn new(id: NodeId, data_partition: DataPartition) -> Self
Create a new worker node
Sourcepub fn compute_local_gradient(&mut self, parameters: &[f64]) -> Result<Vec<f64>>
pub fn compute_local_gradient(&mut self, parameters: &[f64]) -> Result<Vec<f64>>
Compute local gradient on assigned data partition
Sourcepub fn get_stats(&self) -> &WorkerStats
pub fn get_stats(&self) -> &WorkerStats
Get worker statistics
Trait Implementations§
Source§impl Clone for WorkerNode
impl Clone for WorkerNode
Source§fn clone(&self) -> WorkerNode
fn clone(&self) -> WorkerNode
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for WorkerNode
impl RefUnwindSafe for WorkerNode
impl Send for WorkerNode
impl Sync for WorkerNode
impl Unpin for WorkerNode
impl UnwindSafe for WorkerNode
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
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>
Converts
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>
Converts
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