pub struct FederatedCoordinator { /* private fields */ }Expand description
Federated learning coordinator
Aggregates learning from multiple ephemeral agents.
Implementations§
Source§impl FederatedCoordinator
impl FederatedCoordinator
Sourcepub fn new(coordinator_id: impl Into<String>, config: SonaConfig) -> Self
pub fn new(coordinator_id: impl Into<String>, config: SonaConfig) -> Self
Create a new federated coordinator
Sourcepub fn default_coordinator(
coordinator_id: impl Into<String>,
hidden_dim: usize,
) -> Self
pub fn default_coordinator( coordinator_id: impl Into<String>, hidden_dim: usize, ) -> Self
Create with default config for coordination
Sourcepub fn coordinator_id(&self) -> &str
pub fn coordinator_id(&self) -> &str
Get coordinator ID
Sourcepub fn set_quality_threshold(&mut self, threshold: f32)
pub fn set_quality_threshold(&mut self, threshold: f32)
Set quality threshold for accepting trajectories
Sourcepub fn set_consolidation_interval(&mut self, interval: usize)
pub fn set_consolidation_interval(&mut self, interval: usize)
Set consolidation interval
Sourcepub fn master_engine(&self) -> &SonaEngine
pub fn master_engine(&self) -> &SonaEngine
Get master engine reference
Sourcepub fn aggregate(&mut self, export: AgentExport) -> AggregationResult
pub fn aggregate(&mut self, export: AgentExport) -> AggregationResult
Aggregate agent export into coordinator
Sourcepub fn force_consolidate(&self) -> String
pub fn force_consolidate(&self) -> String
Force consolidation
Sourcepub fn get_initial_patterns(&self, k: usize) -> Vec<LearnedPattern>
pub fn get_initial_patterns(&self, k: usize) -> Vec<LearnedPattern>
Get initial state for new agents
Returns learned patterns that new agents can use for warm start.
Sourcepub fn get_all_patterns(&self) -> Vec<LearnedPattern>
pub fn get_all_patterns(&self) -> Vec<LearnedPattern>
Get all learned patterns
Sourcepub fn stats(&self) -> CoordinatorStats
pub fn stats(&self) -> CoordinatorStats
Get coordinator statistics
Sourcepub fn contributions(&self) -> &HashMap<String, AgentContribution>
pub fn contributions(&self) -> &HashMap<String, AgentContribution>
Get contribution history
Sourcepub fn metrics(&self) -> &TrainingMetrics
pub fn metrics(&self) -> &TrainingMetrics
Get metrics
Sourcepub fn agent_count(&self) -> usize
pub fn agent_count(&self) -> usize
Get total number of contributing agents
Sourcepub fn total_trajectories(&self) -> usize
pub fn total_trajectories(&self) -> usize
Get total trajectories aggregated
Sourcepub fn find_patterns(&self, query: &[f32], k: usize) -> Vec<LearnedPattern>
pub fn find_patterns(&self, query: &[f32], k: usize) -> Vec<LearnedPattern>
Find similar patterns
Sourcepub fn apply_lora(&self, input: &[f32]) -> Vec<f32>
pub fn apply_lora(&self, input: &[f32]) -> Vec<f32>
Apply coordinator’s LoRA to input
Sourcepub fn consolidate(&self) -> String
pub fn consolidate(&self) -> String
Consolidate learning (alias for force_consolidate)
Auto Trait Implementations§
impl !Freeze for FederatedCoordinator
impl !RefUnwindSafe for FederatedCoordinator
impl Send for FederatedCoordinator
impl Sync for FederatedCoordinator
impl Unpin for FederatedCoordinator
impl !UnwindSafe for FederatedCoordinator
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