pub struct DistributedLinearRegression {
pub config: DistributedConfig,
pub parameter_server: Arc<RwLock<ParameterServer>>,
pub workers: Vec<WorkerNode>,
pub parameters: Arc<RwLock<ModelParameters>>,
}Expand description
Distributed linear regression using parameter server architecture
Implements distributed training of linear regression models across multiple worker nodes with centralized parameter synchronization.
Fields§
§config: DistributedConfigConfiguration for distributed training
parameter_server: Arc<RwLock<ParameterServer>>Parameter server for coordinating updates
workers: Vec<WorkerNode>Worker nodes performing computation
parameters: Arc<RwLock<ModelParameters>>Current model parameters
Implementations§
Source§impl DistributedLinearRegression
impl DistributedLinearRegression
Sourcepub fn new(config: DistributedConfig, num_features: usize) -> Self
pub fn new(config: DistributedConfig, num_features: usize) -> Self
Create a new distributed linear regression model
Sourcepub fn partition_data(
&mut self,
features: Vec<Vec<f64>>,
targets: Vec<f64>,
) -> Result<()>
pub fn partition_data( &mut self, features: Vec<Vec<f64>>, targets: Vec<f64>, ) -> Result<()>
Partition data across workers
Sourcepub fn get_training_stats(&self) -> DistributedTrainingStats
pub fn get_training_stats(&self) -> DistributedTrainingStats
Get training statistics from all workers
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DistributedLinearRegression
impl RefUnwindSafe for DistributedLinearRegression
impl Send for DistributedLinearRegression
impl Sync for DistributedLinearRegression
impl Unpin for DistributedLinearRegression
impl UnwindSafe for DistributedLinearRegression
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