Trait ClipMut

Source
pub trait ClipMut<T = f32> {
    // Required methods
    fn clip_between(&mut self, min: T, max: T);
    fn clip_inf_nan(&mut self, on_inf: T, on_nan: T);
    fn clip_inf_nan_between(&mut self, boundary: T, on_inf: T, on_nan: T);
    fn clip_inf(&mut self, threshold: T);
    fn clip_max(&mut self, threshold: T);
    fn clip_min(&mut self, threshold: T);
    fn clip_norm_l1(&mut self, threshold: T);
    fn clip_norm_l2(&mut self, threshold: T);
    fn clip_nan(&mut self, threshold: T);
}
Expand description

This trait enables tensor clipping; it is implemented for ArrayBase

Required Methods§

Source

fn clip_between(&mut self, min: T, max: T)

clip the tensor between the minimum and maximum values

Source

fn clip_inf_nan(&mut self, on_inf: T, on_nan: T)

Source

fn clip_inf_nan_between(&mut self, boundary: T, on_inf: T, on_nan: T)

clip the tensor between a boundary value, replacing any infinite or NaN values

Source

fn clip_inf(&mut self, threshold: T)

clip any infinite values in the tensor

Source

fn clip_max(&mut self, threshold: T)

clip the tensor to a maximum threshold

Source

fn clip_min(&mut self, threshold: T)

clip the tensor to a minimum threshold

Source

fn clip_norm_l1(&mut self, threshold: T)

this method normalizes the tensor then clips any values outside of the given threshold. the tensor is normalized using the L1 norm

Source

fn clip_norm_l2(&mut self, threshold: T)

this method normalizes the tensor then clips any values outside of the given threshold. the tensor is normalized using the L2 norm

Source

fn clip_nan(&mut self, threshold: T)

clip any NaN values in the tensor

Implementations on Foreign Types§

Source§

impl<A, S, D> ClipMut<A> for ArrayBase<S, D>
where A: Float + ScalarOperand, S: DataMut<Elem = A>, D: Dimension,

Source§

fn clip_between(&mut self, min: A, max: A)

Source§

fn clip_inf_nan(&mut self, on_inf: A, on_nan: A)

Source§

fn clip_inf_nan_between(&mut self, boundary: A, on_inf: A, on_nan: A)

Source§

fn clip_inf(&mut self, threshold: A)

Source§

fn clip_max(&mut self, threshold: A)

Source§

fn clip_min(&mut self, threshold: A)

Source§

fn clip_nan(&mut self, threshold: A)

Source§

fn clip_norm_l1(&mut self, threshold: A)

Source§

fn clip_norm_l2(&mut self, threshold: A)

Implementors§