Trait Augmenter

Source
pub trait Augmenter {
    // Required methods
    fn augment_one(&self, x: &[f64]) -> Vec<f64>;
    fn get_probability(&self) -> f64;
    fn set_probability(&mut self, probability: f64);
    fn get_name(&self) -> String;

    // Provided methods
    fn augment_batch(
        &self,
        input: &mut Dataset,
        parallel: bool,
        per_sample: bool,
    )
       where Self: Sync { ... }
    fn supports_per_sample(&self) -> bool { ... }
}
Expand description

Trait for all augmenters, allows for augmentation of one time series or a batch

Required Methods§

Source

fn augment_one(&self, x: &[f64]) -> Vec<f64>

Augment one time series

When called, the augmenter will always augment the series no matter what the probability for this augmenter is

Source

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)

By setting a probability with this function the augmenter will only augment a series in a batch with the specified probability

Source

fn get_name(&self) -> String

Provided Methods§

Source

fn augment_batch(&self, input: &mut Dataset, parallel: bool, per_sample: bool)
where Self: Sync,

Augment a whole batch

Parallelized using rayon when parallell is set

Source

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.

Implementors§