pub struct ParameterServer<A: Float, D: Dimension> { /* private fields */ }Expand description
Synchronous parameter server for distributed training
Implementations§
Source§impl<A: Float + ScalarOperand + Debug + Send + Sync, D: Dimension + Send + Sync> ParameterServer<A, D>
impl<A: Float + ScalarOperand + Debug + Send + Sync, D: Dimension + Send + Sync> ParameterServer<A, D>
Sourcepub fn new(
strategy: AveragingStrategy,
numnodes: usize,
expected_updates_per_round: usize,
) -> Self
pub fn new( strategy: AveragingStrategy, numnodes: usize, expected_updates_per_round: usize, ) -> Self
Create a new parameter server
Sourcepub fn initialize(&mut self, initialparams: &[Array<A, D>]) -> Result<()>
pub fn initialize(&mut self, initialparams: &[Array<A, D>]) -> Result<()>
Initialize with global parameters
Sourcepub fn submit_update(
&mut self,
nodeid: usize,
parameters: Vec<Array<A, D>>,
) -> Result<bool>
pub fn submit_update( &mut self, nodeid: usize, parameters: Vec<Array<A, D>>, ) -> Result<bool>
Submit parameter update from a node
Sourcepub fn force_aggregation(&mut self) -> Result<()>
pub fn force_aggregation(&mut self) -> Result<()>
Force aggregation with current pending updates
Sourcepub fn get_global_parameters(&self) -> &[Array<A, D>] ⓘ
pub fn get_global_parameters(&self) -> &[Array<A, D>] ⓘ
Get current global parameters
Sourcepub fn get_global_parameters_cloned(&self) -> Vec<Array<A, D>> ⓘ
pub fn get_global_parameters_cloned(&self) -> Vec<Array<A, D>> ⓘ
Get cloned global parameters
Sourcepub fn current_round(&self) -> usize
pub fn current_round(&self) -> usize
Get current round number
Sourcepub fn get_update_count(&self, nodeid: usize) -> usize
pub fn get_update_count(&self, nodeid: usize) -> usize
Get update count for a node
Sourcepub fn pending_updates_count(&self) -> usize
pub fn pending_updates_count(&self) -> usize
Get number of pending updates
Sourcepub fn set_node_weight(&mut self, nodeid: usize, weight: A) -> Result<()>
pub fn set_node_weight(&mut self, nodeid: usize, weight: A) -> Result<()>
Set node weight for weighted averaging
Trait Implementations§
Auto Trait Implementations§
impl<A, D> Freeze for ParameterServer<A, D>
impl<A, D> RefUnwindSafe for ParameterServer<A, D>where
D: RefUnwindSafe,
A: RefUnwindSafe,
impl<A, D> Send for ParameterServer<A, D>where
A: Send,
impl<A, D> Sync for ParameterServer<A, D>where
A: Sync,
impl<A, D> Unpin for ParameterServer<A, D>
impl<A, D> UnwindSafe for ParameterServer<A, D>
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> 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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.