pub struct ParameterServer {
pub parameters: Vec<f64>,
pub version: usize,
pub gradient_accumulator: Vec<f64>,
pub num_workers: usize,
pub updates_received: usize,
}Expand description
Parameter server for coordinating distributed training
Fields§
§parameters: Vec<f64>Current global parameters
version: usizeVersion number for parameters
gradient_accumulator: Vec<f64>Gradient accumulator
num_workers: usizeNumber of workers
updates_received: usizeUpdates received in current iteration
Implementations§
Source§impl ParameterServer
impl ParameterServer
Sourcepub fn receive_gradient(&mut self, gradient: Vec<f64>) -> Result<()>
pub fn receive_gradient(&mut self, gradient: Vec<f64>) -> Result<()>
Receive gradient update from worker
Sourcepub fn get_parameters(&self) -> Vec<f64>
pub fn get_parameters(&self) -> Vec<f64>
Get current parameters
Sourcepub fn get_version(&self) -> usize
pub fn get_version(&self) -> usize
Get parameter version
Trait Implementations§
Source§impl Clone for ParameterServer
impl Clone for ParameterServer
Source§fn clone(&self) -> ParameterServer
fn clone(&self) -> ParameterServer
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 ParameterServer
impl RefUnwindSafe for ParameterServer
impl Send for ParameterServer
impl Sync for ParameterServer
impl Unpin for ParameterServer
impl UnwindSafe for ParameterServer
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