pub struct ModelEnsemble { /* private fields */ }Expand description
Model ensemble for combining multiple models
Implementations§
Source§impl ModelEnsemble
impl ModelEnsemble
Sourcepub fn new(
models: Vec<Box<dyn AutoregressiveModel>>,
config: EnsembleConfig,
) -> InferenceResult<Self>
pub fn new( models: Vec<Box<dyn AutoregressiveModel>>, config: EnsembleConfig, ) -> InferenceResult<Self>
Create a new model ensemble
Sourcepub fn num_models(&self) -> usize
pub fn num_models(&self) -> usize
Get number of models in ensemble
Sourcepub fn step(&mut self, input: &Array1<f32>) -> InferenceResult<Array1<f32>>
pub fn step(&mut self, input: &Array1<f32>) -> InferenceResult<Array1<f32>>
Perform ensemble inference step
Sourcepub fn config(&self) -> &EnsembleConfig
pub fn config(&self) -> &EnsembleConfig
Get ensemble configuration
Sourcepub fn sampler_mut(&mut self) -> &mut Sampler
pub fn sampler_mut(&mut self) -> &mut Sampler
Get mutable access to sampler
Auto Trait Implementations§
impl Freeze for ModelEnsemble
impl !RefUnwindSafe for ModelEnsemble
impl Send for ModelEnsemble
impl !Sync for ModelEnsemble
impl Unpin for ModelEnsemble
impl !UnwindSafe for ModelEnsemble
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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