Skip to main content

StreamingOptimizer

Struct StreamingOptimizer 

Source
pub struct StreamingOptimizer<O, A, D>
where A: Float + Send + Sync + ScalarOperand + Debug, D: Dimension, O: Optimizer<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: usize

Current step count

Implementations§

Source§

impl<O, A, D> StreamingOptimizer<O, A, D>
where A: Float + Default + Clone + Send + Sync + Debug + ScalarOperand + Sum + DivAssign, D: Dimension, O: Optimizer<A, D> + Send + Sync,

Source

pub fn new(baseoptimizer: O, config: StreamingConfig) -> Result<Self>

Create a new streaming optimizer

Source

pub fn process_sample( &mut self, data_point: StreamingDataPoint<A>, ) -> Result<Option<Array1<A>>>

Process a single streaming data point

Source

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.

Source

pub fn lr_adaptation_interval(&self) -> Duration

The configured learning-rate adaptation interval.

Source

pub fn get_metrics(&self) -> &StreamingMetrics

Get current streaming metrics

Source

pub fn last_gradient(&self) -> Option<&Array1<A>>

The gradient most recently applied to the parameters, if any.

Source

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).

Source

pub fn is_healthy(&self) -> StreamingHealthStatus

Check if streaming optimizer is healthy (within budgets)

Source

pub fn flush(&mut self) -> Result<Option<Array1<A>>>

Force processing of current buffer

Source§

impl<O, A, D> StreamingOptimizer<O, A, D>
where A: Float + Default + Clone + Send + Sync + Debug + ScalarOperand + Sum + DivAssign, D: Dimension, O: Optimizer<A, D> + Send + Sync,

Source

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.

Source

pub fn registered_stream_count(&self) -> usize

Number of distinct logical streams observed so far.

Source

pub fn multi_stream_coordinator(&self) -> Option<&MultiStreamCoordinator<A>>

Read-only access to the multi-stream coordinator.

Source

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.

Source

pub fn pipeline(&self) -> &PipelineExecutionManager<A>

Read-only access to the pipeline manager and its measured stage metrics.

Source

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.

Source

pub fn fusion_optimizer(&self) -> Option<&StreamFusionOptimizer<A>>

Read-only access to the stream fusion optimizer.

Source

pub fn predictive_engine(&self) -> Option<&PredictiveStreamingEngine<A>>

Read-only access to the predictive engine.

Source

pub fn prediction_confidence(&self) -> A

Measured confidence of the predictive engine in [0, 1]; zero while the engine is disabled or untrained.

Source

pub fn normalized_prediction_error(&self) -> A

Measured normalized one-step prediction error of the predictive engine.

Source

pub fn forecast_len(&self) -> usize

Number of points in the predictive engine’s most recent forecast.

Source

pub fn qos_status(&self) -> &QoSStatus

The most recent QoS evaluation.

Source

pub fn qos_pressure(&self) -> f64

How far outside its service level objectives the system currently is.

Source

pub fn resource_allocation(&self) -> Option<&ResourceAllocation>

The most recent resource allocation decision, if adaptive resource allocation is enabled.

Source

pub fn realtime_result(&self) -> Option<&RTOptimizationResult>

The most recent real-time optimization outcome.

Source

pub fn realtime_optimizer(&self) -> &RealTimeOptimizer

Read-only access to the real-time optimizer and its measurements.

Source

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>
where O: Freeze, A: Freeze,

§

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>
where O: Unpin, A: Unpin, D: Unpin,

§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

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

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V