pub struct DistributedCoordinator<A: Float, D: Dimension> { /* private fields */ }
Expand description
Distributed training coordinator
Implementations§
Source§impl<A: Float + ScalarOperand + Debug, D: Dimension> DistributedCoordinator<A, D>
impl<A: Float + ScalarOperand + Debug, D: Dimension> DistributedCoordinator<A, D>
Sourcepub fn new(
strategy: AveragingStrategy,
num_nodes: usize,
expected_updates_per_round: usize,
max_rounds: usize,
) -> Self
pub fn new( strategy: AveragingStrategy, num_nodes: usize, expected_updates_per_round: usize, max_rounds: usize, ) -> Self
Create a new distributed coordinator
Sourcepub fn initialize(&mut self, initial_params: &[Array<A, D>]) -> Result<()>
pub fn initialize(&mut self, initial_params: &[Array<A, D>]) -> Result<()>
Initialize coordinator
Sourcepub fn communication_round(
&mut self,
node_updates: Vec<(usize, Vec<Array<A, D>>)>,
) -> Result<CommunicationResult<A, D>>
pub fn communication_round( &mut self, node_updates: Vec<(usize, Vec<Array<A, D>>)>, ) -> Result<CommunicationResult<A, D>>
Execute a communication round
Sourcepub fn set_convergence_threshold(&mut self, threshold: A)
pub fn set_convergence_threshold(&mut self, threshold: A)
Set convergence threshold
Sourcepub fn parameter_server(&self) -> &ParameterServer<A, D>
pub fn parameter_server(&self) -> &ParameterServer<A, D>
Get parameter server reference
Sourcepub fn parameter_server_mut(&mut self) -> &mut ParameterServer<A, D>
pub fn parameter_server_mut(&mut self) -> &mut ParameterServer<A, D>
Get mutable parameter server reference
Trait Implementations§
Auto Trait Implementations§
impl<A, D> Freeze for DistributedCoordinator<A, D>where
A: Freeze,
impl<A, D> RefUnwindSafe for DistributedCoordinator<A, D>where
A: RefUnwindSafe,
D: RefUnwindSafe,
impl<A, D> Send for DistributedCoordinator<A, D>where
A: Send,
impl<A, D> Sync for DistributedCoordinator<A, D>where
A: Sync,
impl<A, D> Unpin for DistributedCoordinator<A, D>
impl<A, D> UnwindSafe for DistributedCoordinator<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 more