pub struct RandomTimeWarpAugmenter {
pub name: String,
pub window_size: usize,
pub speed_ratio_range: (f64, f64),
/* private fields */
}Expand description
Augmenter that applies random time warping to the dataset
This augmenter randomly selects a window of the time series, specified by the window_size argument and applies a speed change to it.
The speed change is defined by the speed_ratio_range argument, which specifies the minimum and maximum speed ratio.
The speed ratio is a multiplier that affects how fast or slow the selected window is stretched or compressed.
If the window size is 0 or larger than the time series length, the entire series is warped.
Fields§
§name: String§window_size: usizeLength of the window to warp - a window of this size will be selected randomly for every time series in the dataset
speed_ratio_range: (f64, f64)Range for random speed ratio: [min, max]
Implementations§
Trait Implementations§
Source§impl Augmenter for RandomTimeWarpAugmenter
impl Augmenter for RandomTimeWarpAugmenter
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 RandomTimeWarpAugmenter
impl RefUnwindSafe for RandomTimeWarpAugmenter
impl Send for RandomTimeWarpAugmenter
impl Sync for RandomTimeWarpAugmenter
impl Unpin for RandomTimeWarpAugmenter
impl UnwindSafe for RandomTimeWarpAugmenter
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