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§
Sourcefn clip_between(&mut self, min: T, max: T)
fn clip_between(&mut self, min: T, max: T)
clip the tensor between the minimum and maximum values
fn clip_inf_nan(&mut self, on_inf: T, on_nan: T)
Sourcefn clip_inf_nan_between(&mut self, boundary: T, on_inf: T, on_nan: T)
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
Sourcefn clip_norm_l1(&mut self, threshold: T)
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
Sourcefn clip_norm_l2(&mut self, threshold: T)
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