pub trait Weighted<S, D>{
// Required methods
fn weights(&self) -> &ArrayBase<S, D>;
fn weights_mut(&mut self) -> &mut ArrayBase<S, D>;
// Provided methods
fn assign_weights(&mut self, weights: &ArrayBase<S, D>) -> &mut Self
where S: DataMut,
S::Elem: Clone { ... }
fn replace_weights(&mut self, weights: ArrayBase<S, D>) -> ArrayBase<S, D> { ... }
fn set_weights(&mut self, weights: ArrayBase<S, D>) -> &mut Self { ... }
fn iter_weights<'a>(&'a self) -> Iter<'a, S::Elem, D>
where S: Data + 'a,
D: 'a { ... }
fn iter_weights_mut<'a>(&'a mut self) -> IterMut<'a, S::Elem, D>
where S: DataMut + 'a,
D: 'a { ... }
}
Required Methods§
Sourcefn weights_mut(&mut self) -> &mut ArrayBase<S, D>
fn weights_mut(&mut self) -> &mut ArrayBase<S, D>
returns a mutable reference to the weights of the model
Provided Methods§
Sourcefn assign_weights(&mut self, weights: &ArrayBase<S, D>) -> &mut Self
fn assign_weights(&mut self, weights: &ArrayBase<S, D>) -> &mut Self
assigns the given bias to the current weight
Sourcefn replace_weights(&mut self, weights: ArrayBase<S, D>) -> ArrayBase<S, D>
fn replace_weights(&mut self, weights: ArrayBase<S, D>) -> ArrayBase<S, D>
replaces the current weights with the given weights
Sourcefn set_weights(&mut self, weights: ArrayBase<S, D>) -> &mut Self
fn set_weights(&mut self, weights: ArrayBase<S, D>) -> &mut Self
sets the weights of the model
Sourcefn iter_weights<'a>(&'a self) -> Iter<'a, S::Elem, D>where
S: Data + 'a,
D: 'a,
fn iter_weights<'a>(&'a self) -> Iter<'a, S::Elem, D>where
S: Data + 'a,
D: 'a,
returns an iterator over the weights
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.