Trait Weighted

Source
pub trait Weighted<S, D>
where D: Dimension, S: RawData,
{ // 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§

Source

fn weights(&self) -> &ArrayBase<S, D>

returns the weights of the model

Source

fn weights_mut(&mut self) -> &mut ArrayBase<S, D>

returns a mutable reference to the weights of the model

Provided Methods§

Source

fn assign_weights(&mut self, weights: &ArrayBase<S, D>) -> &mut Self
where S: DataMut, S::Elem: Clone,

assigns the given bias to the current weight

Source

fn replace_weights(&mut self, weights: ArrayBase<S, D>) -> ArrayBase<S, D>

replaces the current weights with the given weights

Source

fn set_weights(&mut self, weights: ArrayBase<S, D>) -> &mut Self

sets the weights of the model

Source

fn iter_weights<'a>(&'a self) -> Iter<'a, S::Elem, D>
where S: Data + 'a, D: 'a,

returns an iterator over the weights

Source

fn iter_weights_mut<'a>(&'a mut self) -> IterMut<'a, S::Elem, D>
where S: DataMut + 'a, D: 'a,

returns a mutable iterator over the weights; see iter_mut for more

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.

Implementors§

Source§

impl<S, D> Weighted<S, D> for ParamsBase<S, D>
where S: RawData, D: Dimension,