pub struct StreamingOptimizer<O, A, D>{
pub data_buffer: VecDeque<StreamingDataPoint<A>>,
pub step_count: usize,
/* private fields */
}Expand description
Streaming gradient descent optimizer
Fields§
§data_buffer: VecDeque<StreamingDataPoint<A>>Data buffer for mini-batches
step_count: usizeCurrent step count
Implementations§
Source§impl<O, A, D> StreamingOptimizer<O, A, D>
impl<O, A, D> StreamingOptimizer<O, A, D>
Sourcepub fn new(baseoptimizer: O, config: StreamingConfig) -> Result<Self>
pub fn new(baseoptimizer: O, config: StreamingConfig) -> Result<Self>
Create a new streaming optimizer
Sourcepub fn process_sample(
&mut self,
data_point: StreamingDataPoint<A>,
) -> Result<Option<Array1<A>>>
pub fn process_sample( &mut self, data_point: StreamingDataPoint<A>, ) -> Result<Option<Array1<A>>>
Process a single streaming data point
Sourcepub fn set_lr_adaptation_interval(&mut self, interval: Duration)
pub fn set_lr_adaptation_interval(&mut self, interval: Duration)
Throttle learning-rate adaptation to at most once per interval.
Duration::ZERO (the default) adapts on every processed batch.
Sourcepub fn lr_adaptation_interval(&self) -> Duration
pub fn lr_adaptation_interval(&self) -> Duration
The configured learning-rate adaptation interval.
Sourcepub fn get_metrics(&self) -> &StreamingMetrics
pub fn get_metrics(&self) -> &StreamingMetrics
Get current streaming metrics
Sourcepub fn last_gradient(&self) -> Option<&Array1<A>>
pub fn last_gradient(&self) -> Option<&Array1<A>>
The gradient most recently applied to the parameters, if any.
Sourcepub fn current_parameters(&self) -> Option<&Array1<A>>
pub fn current_parameters(&self) -> Option<&Array1<A>>
Get the live model parameters currently maintained by the streaming optimizer, if any samples have been processed yet (F27: parameters are tracked on the optimizer itself, not recomputed from nothing).
Sourcepub fn is_healthy(&self) -> StreamingHealthStatus
pub fn is_healthy(&self) -> StreamingHealthStatus
Check if streaming optimizer is healthy (within budgets)
Source§impl<O, A, D> StreamingOptimizer<O, A, D>
impl<O, A, D> StreamingOptimizer<O, A, D>
Sourcepub fn stream_synchronization_skew_ms(&self) -> Option<f64>
pub fn stream_synchronization_skew_ms(&self) -> Option<f64>
Measured inter-stream synchronization skew (ms), if multi-stream coordination is enabled and at least two streams have been seen.
Sourcepub fn registered_stream_count(&self) -> usize
pub fn registered_stream_count(&self) -> usize
Number of distinct logical streams observed so far.
Sourcepub fn multi_stream_coordinator(&self) -> Option<&MultiStreamCoordinator<A>>
pub fn multi_stream_coordinator(&self) -> Option<&MultiStreamCoordinator<A>>
Read-only access to the multi-stream coordinator.
Sourcepub fn add_pipeline_stage(
&mut self,
stage_id: impl Into<String>,
processing_function: &str,
) -> Result<()>
pub fn add_pipeline_stage( &mut self, stage_id: impl Into<String>, processing_function: &str, ) -> Result<()>
Append a processing stage to the pipeline every batch flows through. The stage function name is validated immediately.
Sourcepub fn pipeline(&self) -> &PipelineExecutionManager<A>
pub fn pipeline(&self) -> &PipelineExecutionManager<A>
Read-only access to the pipeline manager and its measured stage metrics.
Sourcepub fn fusion_optimizer_mut(&mut self) -> Option<&mut StreamFusionOptimizer<A>>
pub fn fusion_optimizer_mut(&mut self) -> Option<&mut StreamFusionOptimizer<A>>
Mutable access to the stream fusion optimizer, for selecting a fusion strategy or consensus algorithm.
Sourcepub fn fusion_optimizer(&self) -> Option<&StreamFusionOptimizer<A>>
pub fn fusion_optimizer(&self) -> Option<&StreamFusionOptimizer<A>>
Read-only access to the stream fusion optimizer.
Sourcepub fn predictive_engine(&self) -> Option<&PredictiveStreamingEngine<A>>
pub fn predictive_engine(&self) -> Option<&PredictiveStreamingEngine<A>>
Read-only access to the predictive engine.
Sourcepub fn prediction_confidence(&self) -> A
pub fn prediction_confidence(&self) -> A
Measured confidence of the predictive engine in [0, 1]; zero while
the engine is disabled or untrained.
Sourcepub fn normalized_prediction_error(&self) -> A
pub fn normalized_prediction_error(&self) -> A
Measured normalized one-step prediction error of the predictive engine.
Sourcepub fn forecast_len(&self) -> usize
pub fn forecast_len(&self) -> usize
Number of points in the predictive engine’s most recent forecast.
Sourcepub fn qos_status(&self) -> &QoSStatus
pub fn qos_status(&self) -> &QoSStatus
The most recent QoS evaluation.
Sourcepub fn qos_pressure(&self) -> f64
pub fn qos_pressure(&self) -> f64
How far outside its service level objectives the system currently is.
Sourcepub fn resource_allocation(&self) -> Option<&ResourceAllocation>
pub fn resource_allocation(&self) -> Option<&ResourceAllocation>
The most recent resource allocation decision, if adaptive resource allocation is enabled.
Sourcepub fn realtime_result(&self) -> Option<&RTOptimizationResult>
pub fn realtime_result(&self) -> Option<&RTOptimizationResult>
The most recent real-time optimization outcome.
Sourcepub fn realtime_optimizer(&self) -> &RealTimeOptimizer
pub fn realtime_optimizer(&self) -> &RealTimeOptimizer
Read-only access to the real-time optimizer and its measurements.
Sourcepub fn cpu_duty_cycle_percent(&self) -> f64
pub fn cpu_duty_cycle_percent(&self) -> f64
Measured fraction of wall-clock time this optimizer has spent actually processing batches, as a percentage. A real duty-cycle measurement, not a guess at system-wide CPU load.
Auto Trait Implementations§
impl<O, A, D> Freeze for StreamingOptimizer<O, A, D>
impl<O, A, D> RefUnwindSafe for StreamingOptimizer<O, A, D>
impl<O, A, D> Send for StreamingOptimizer<O, A, D>where
O: Send,
impl<O, A, D> Sync for StreamingOptimizer<O, A, D>where
O: Sync,
impl<O, A, D> Unpin for StreamingOptimizer<O, A, D>
impl<O, A, D> UnsafeUnpin for StreamingOptimizer<O, A, D>where
O: UnsafeUnpin,
A: UnsafeUnpin,
impl<O, A, D> UnwindSafe for StreamingOptimizer<O, 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> ⓘ
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> ⓘ
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
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
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>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
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
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.