pub struct RandomMix { /* private fields */ }Expand description
Draws from several datasets at given probabilities.
Implementations§
Source§impl RandomMix
impl RandomMix
Sourcepub fn new(datasets: Vec<DataPipeline>) -> RandomMix
pub fn new(datasets: Vec<DataPipeline>) -> RandomMix
Mix these datasets with equal weight.
Sourcepub fn with_weights(self, weights: &[f64]) -> Result<RandomMix>
pub fn with_weights(self, weights: &[f64]) -> Result<RandomMix>
Weight each dataset; weights need not sum to one.
Trait Implementations§
Source§impl Stage for RandomMix
impl Stage for RandomMix
Source§fn apply(&self, _input: SampleStream) -> SampleStream
fn apply(&self, _input: SampleStream) -> SampleStream
Transform the incoming stream. Source stages ignore
input.Auto Trait Implementations§
impl !RefUnwindSafe for RandomMix
impl !UnwindSafe for RandomMix
impl Freeze for RandomMix
impl Send for RandomMix
impl Sync for RandomMix
impl Unpin for RandomMix
impl UnsafeUnpin for RandomMix
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CustomValue for T
impl<T> CustomValue for T
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