pub struct AddNoise {
pub name: String,
pub noise_type: NoiseType,
pub bounds: Option<(f64, f64)>,
pub mean: Option<f64>,
pub std_dev: Option<f64>,
pub p: f64,
}Expand description
Augmenter that allows different types of noise injection
Noise types:
- Uniform: Adds uniform noise within the given bounds given through the parameter
bounds - Gaussian: Adds gaussian noise with the specified mean and standard deviation according to the corresponding parameters
- Spike: Adds a spike in the series with a random magnitude (in the range specified by
boundsof the standard deviation of the original time series - Slope: Adds a linear slope trend to the series with a random slope in the range specified by
bounds
Fields§
§name: String§noise_type: NoiseType§bounds: Option<(f64, f64)>§mean: Option<f64>§std_dev: Option<f64>§p: f64Implementations§
Trait Implementations§
Source§impl Augmenter for AddNoise
impl Augmenter for AddNoise
Source§fn get_probability(&self) -> f64
fn get_probability(&self) -> f64
Get the probability that this augmenter will augment a series in a batch
Source§fn set_probability(&mut self, probability: f64)
fn set_probability(&mut self, probability: f64)
By setting a probability with this function the augmenter will only augment a series in a
batch with the specified probability
fn get_name(&self) -> String
Source§fn augment_batch(&self, input: &mut Dataset, parallel: bool, per_sample: bool)where
Self: Sync,
fn augment_batch(&self, input: &mut Dataset, parallel: bool, per_sample: bool)where
Self: Sync,
Augment a whole batch Read more
Source§fn supports_per_sample(&self) -> bool
fn supports_per_sample(&self) -> bool
Indicate whether this augmenter supports per-sample chaining.
By default, return true. Augmenters that need a batch level view
should override this to return false.
Auto Trait Implementations§
impl Freeze for AddNoise
impl RefUnwindSafe for AddNoise
impl Send for AddNoise
impl Sync for AddNoise
impl Unpin for AddNoise
impl UnwindSafe for AddNoise
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<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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