Struct ParamsBase

Source
pub struct ParamsBase<S, D = Dim<[usize; 2]>>
where D: Dimension, S: RawData,
{ /* private fields */ }
Expand description

The ParamsBase struct is a generic container for a set of weights and biases for a model where the bias tensor is always n-1 dimensions smaller than the weights tensor. Consequently, this constrains the ParamsBase implementation to only support dimensions that can be reduced by one axis (i.e. $\mbox{rank}(D)>0$), which is typically the “zero-th” axis.

Implementations§

Source§

impl<A, S, D> ParamsBase<S, D>
where D: Dimension, S: RawData<Elem = A>,

Source

pub const fn new( bias: ArrayBase<S, <D as Dimension>::Smaller>, weights: ArrayBase<S, D>, ) -> ParamsBase<S, D>

create a new instance of the ParamsBase with the given bias and weights

Source

pub fn init_from_fn<Sh, F>(shape: Sh, init: F) -> ParamsBase<S, D>
where A: Clone, D: RemoveAxis, S: DataOwned, Sh: ShapeBuilder<Dim = D>, F: Fn() -> A,

returns a new instance of the ParamsBase using the initialization routine

Source

pub fn from_shape_fn<Sh, F>(shape: Sh, f: F) -> ParamsBase<S, D>
where A: Clone, D: RemoveAxis, S: DataOwned, Sh: ShapeBuilder<Dim = D>, <D as Dimension>::Smaller: Dimension + ShapeArg, F: Fn(<<D as Dimension>::Smaller as Dimension>::Pattern) -> A + Fn(<D as Dimension>::Pattern),

returns a new instance of the ParamsBase initialized use the given shape_function

Source

pub fn from_bias<Sh>( shape: Sh, bias: ArrayBase<S, <D as Dimension>::Smaller>, ) -> ParamsBase<S, D>
where A: Clone + Default, D: RemoveAxis, S: DataOwned, Sh: ShapeBuilder<Dim = D>,

create a new instance of the ParamsBase with the given bias used the default weights

Source

pub fn from_weights<Sh>(shape: Sh, weights: ArrayBase<S, D>) -> ParamsBase<S, D>
where A: Clone + Default, D: RemoveAxis, S: DataOwned, Sh: ShapeBuilder<Dim = D>,

create a new instance of the ParamsBase with the given weights used the default bias

Source

pub fn from_elem<Sh>(shape: Sh, elem: A) -> ParamsBase<S, D>
where A: Clone, D: RemoveAxis, S: DataOwned, Sh: ShapeBuilder<Dim = D>,

create a new instance of the ParamsBase from the given shape and element;

Source

pub fn default<Sh>(shape: Sh) -> ParamsBase<S, D>
where A: Clone + Default, D: RemoveAxis, S: DataOwned, Sh: ShapeBuilder<Dim = D>,

create an instance of the parameters with all values set to the default value

Source

pub fn ones<Sh>(shape: Sh) -> ParamsBase<S, D>
where A: Clone + One, D: RemoveAxis, S: DataOwned, Sh: ShapeBuilder<Dim = D>,

initialize the parameters with all values set to zero

Source

pub fn zeros<Sh>(shape: Sh) -> ParamsBase<S, D>
where A: Clone + Zero, D: RemoveAxis, S: DataOwned, Sh: ShapeBuilder<Dim = D>,

create an instance of the parameters with all values set to zero

Source

pub const fn bias(&self) -> &ArrayBase<S, <D as Dimension>::Smaller>

returns an immutable reference to the bias

Source

pub const fn bias_mut(&mut self) -> &mut ArrayBase<S, <D as Dimension>::Smaller>

returns a mutable reference to the bias

Source

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

returns an immutable reference to the weights

Source

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

returns a mutable reference to the weights

Source

pub fn assign_bias( &mut self, bias: &ArrayBase<S, <D as Dimension>::Smaller>, ) -> &mut ParamsBase<S, D>
where A: Clone, S: DataMut,

assign the bias

Source

pub fn assign_weights( &mut self, weights: &ArrayBase<S, D>, ) -> &mut ParamsBase<S, D>
where A: Clone, S: DataMut,

assign the weights

Source

pub fn replace_bias( &mut self, bias: ArrayBase<S, <D as Dimension>::Smaller>, ) -> ArrayBase<S, <D as Dimension>::Smaller>

replace the bias and return the previous state; uses replace

Source

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

replace the weights and return the previous state; uses replace

Source

pub fn set_bias( &mut self, bias: ArrayBase<S, <D as Dimension>::Smaller>, ) -> &mut ParamsBase<S, D>

set the bias

Source

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

set the weights

Source

pub fn backward<X, Y, Z>( &mut self, input: &X, grad: &Y, lr: A, ) -> Result<Z, Error>
where A: Clone, S: Data, ParamsBase<S, D>: Backward<X, Y, Elem = A, Output = Z>,

perform a single backpropagation step

Source

pub fn forward<X, Y>(&self, input: &X) -> Result<Y, Error>
where A: Clone, S: Data, ParamsBase<S, D>: Forward<X, Output = Y>,

forward propagation

Source

pub fn dim(&self) -> <D as Dimension>::Pattern

returns the dimensions of the weights

Source

pub fn is_empty(&self) -> bool

returns true if both the weights and bias are empty; uses is_empty

Source

pub fn is_weights_empty(&self) -> bool

returns true if the weights are empty

Source

pub fn is_bias_empty(&self) -> bool

returns true if the bias is empty

Source

pub fn count_weight(&self) -> usize

the total number of elements within the weight tensor

Source

pub fn count_bias(&self) -> usize

the total number of elements within the bias tensor

Source

pub fn raw_dim(&self) -> D

returns the raw dimensions of the weights;

Source

pub fn shape(&self) -> &[usize]

returns the shape of the parameters; uses the shape of the weight tensor

Source

pub fn shape_bias(&self) -> &[usize]

returns the shape of the bias tensor; the shape should be equivalent to that of the weight tensor minus the “zero-th” axis

Source

pub fn size(&self) -> usize

returns the total number of parameters within the layer

Source

pub fn to_owned(&self) -> ParamsBase<OwnedRepr<A>, D>
where A: Clone, S: DataOwned,

returns an owned instance of the parameters

Source

pub fn to_shape<Sh>( &self, shape: Sh, ) -> Result<ParamsBase<CowRepr<'_, A>, <Sh as ShapeBuilder>::Dim>, Error>

change the shape of the parameters; the shape of the bias parameters is determined by removing the “zero-th” axis of the given shape

Source

pub fn to_shared(&self) -> ParamsBase<OwnedArcRepr<A>, D>
where A: Clone, S: Data,

returns a new ParamsBase instance with the same paramaters, but using a shared representation of the data;

Source

pub fn view(&self) -> ParamsBase<ViewRepr<&A>, D>
where S: Data,

returns a “view” of the parameters; see view for more information

Source

pub fn view_mut(&mut self) -> ParamsBase<ViewRepr<&mut A>, D>
where S: DataMut,

returns mutable view of the parameters; see view_mut for more information

Source§

impl<A, S> ParamsBase<S, Dim<[usize; 1]>>
where S: RawData<Elem = A>,

Source

pub fn from_scalar_bias( bias: A, weights: ArrayBase<S, Dim<[usize; 1]>>, ) -> ParamsBase<S, Dim<[usize; 1]>>
where A: Clone, S: DataOwned,

returns a new instance of the ParamsBase initialized using a scalar bias along with the given, one-dimensional weight tensor.

Source

pub fn nrows(&self) -> usize

returns the number of rows in the weights matrix

Source§

impl<A, S> ParamsBase<S>
where S: RawData<Elem = A>,

Source

pub fn ncols(&self) -> usize

returns the number of columns in the weights matrix

Source

pub fn nrows(&self) -> usize

returns the number of rows in the weights matrix

Source§

impl<S, D, A> ParamsBase<S, D>
where S: RawData<Elem = A>, D: Dimension,

Here, we implement various iterators for the parameters and its constituents. The core iterators are:

  • immutable and mutable iterators over each parameter (weights and bias) respectively;
  • an iterator over the parameters, which zips together an axis iterator over the columns of the weights and an iterator over the bias;
Source

pub fn iter(&self) -> Iter<'_, A, D>
where D: RemoveAxis, S: Data,

an iterator of the parameters; the created iterator zips together an axis iterator over the columns of the weights and an iterator over the bias

Source

pub fn iter_mut(&mut self) -> IterMut<'_, A, D>
where D: RemoveAxis, S: DataMut,

returns a mutable iterator of the parameters, IterMut, which essentially zips together a mutable axis iterator over the columns of the weights against a mutable iterator over the elements of the bias

Source

pub fn iter_bias(&self) -> Iter<'_, A, <D as Dimension>::Smaller>
where S: Data,

returns an iterator over the bias

Source

pub fn iter_bias_mut(&mut self) -> IterMut<'_, A, <D as Dimension>::Smaller>
where S: DataMut,

returns a mutable iterator over the bias

Source

pub fn iter_weights(&self) -> Iter<'_, A, D>
where S: Data,

returns an iterator over the weights

Source

pub fn iter_weights_mut(&mut self) -> IterMut<'_, A, D>
where S: DataMut,

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

Source§

impl<A, S, D> ParamsBase<S, D>
where A: ScalarOperand + Float + FromPrimitive, D: Dimension, S: Data<Elem = A>,

Source

pub fn l1_norm(&self) -> A

Returns the L1 norm of the parameters (bias and weights).

Source

pub fn l2_norm(&self) -> A

Returns the L2 norm of the parameters (bias and weights).

Source

pub fn apply_gradient<Delta, Z>( &mut self, grad: &Delta, lr: A, ) -> Result<Z, Error>
where S: DataMut, ParamsBase<S, D>: ApplyGradient<Delta, A, Output = Z>,

a convenience method used to apply a gradient to the parameters using the given learning rate.

Source

pub fn apply_gradient_with_decay<Grad, Z>( &mut self, grad: &Grad, lr: A, decay: A, ) -> Result<Z, Error>
where S: DataMut, ParamsBase<S, D>: ApplyGradient<Grad, A, Output = Z>,

Source

pub fn apply_gradient_with_momentum<Grad, V, Z>( &mut self, grad: &Grad, lr: A, momentum: A, velocity: &mut V, ) -> Result<Z, Error>
where S: DataMut, ParamsBase<S, D>: ApplyGradientExt<Grad, A, Output = Z, Velocity = V>,

Source

pub fn apply_gradient_with_decay_and_momentum<Grad, V, Z>( &mut self, grad: &Grad, lr: A, decay: A, momentum: A, velocity: &mut V, ) -> Result<Z, Error>
where S: DataMut, ParamsBase<S, D>: ApplyGradientExt<Grad, A, Output = Z, Velocity = V>,

Source§

impl<A, S, D> ParamsBase<S, D>
where A: Float + FromPrimitive + ScalarOperand, D: Dimension, S: RawData<Elem = A>,

Source

pub fn random_with<Dst, Sh>(shape: Sh, distr: Dst) -> ParamsBase<S, D>
where D: RemoveAxis, S: DataOwned, Sh: ShapeBuilder<Dim = D>, Dst: Clone + Distribution<A>,

returns a new instance of the ParamsBase with the given shape and values initialized according to the provided random distribution distr.

Trait Implementations§

Source§

impl<A, S, T, D> ApplyGradient<ParamsBase<T, D>, A> for ParamsBase<S, D>
where A: Float + FromPrimitive + ScalarOperand, S: DataMut<Elem = A>, T: Data<Elem = A>, D: Dimension,

Source§

type Output = ()

Source§

fn apply_gradient( &mut self, grad: &ParamsBase<T, D>, lr: A, ) -> Result<<ParamsBase<S, D> as ApplyGradient<ParamsBase<T, D>, A>>::Output, Error>

Source§

fn apply_gradient_with_decay( &mut self, grad: &ParamsBase<T, D>, lr: A, decay: A, ) -> Result<<ParamsBase<S, D> as ApplyGradient<ParamsBase<T, D>, A>>::Output, Error>

Source§

impl<A, S, T, D> ApplyGradientExt<ParamsBase<T, D>, A> for ParamsBase<S, D>
where A: Float + FromPrimitive + ScalarOperand, S: DataMut<Elem = A>, T: Data<Elem = A>, D: Dimension,

Source§

type Velocity = ParamsBase<OwnedRepr<A>, D>

Source§

fn apply_gradient_with_momentum( &mut self, grad: &ParamsBase<T, D>, lr: A, momentum: A, velocity: &mut <ParamsBase<S, D> as ApplyGradientExt<ParamsBase<T, D>, A>>::Velocity, ) -> Result<(), Error>

Source§

fn apply_gradient_with_decay_and_momentum( &mut self, grad: &ParamsBase<T, D>, lr: A, decay: A, momentum: A, velocity: &mut <ParamsBase<S, D> as ApplyGradientExt<ParamsBase<T, D>, A>>::Velocity, ) -> Result<(), Error>

Source§

impl<A, S, T> Backward<ArrayBase<S, Dim<[usize; 1]>>, ArrayBase<T, Dim<[usize; 0]>>> for ParamsBase<OwnedRepr<A>, Dim<[usize; 1]>>
where A: Float + FromPrimitive + ScalarOperand, S: Data<Elem = A>, T: Data<Elem = A>,

Source§

type Elem = A

Source§

type Output = A

Source§

fn backward( &mut self, input: &ArrayBase<S, Dim<[usize; 1]>>, delta: &ArrayBase<T, Dim<[usize; 0]>>, gamma: <ParamsBase<OwnedRepr<A>, Dim<[usize; 1]>> as Backward<ArrayBase<S, Dim<[usize; 1]>>, ArrayBase<T, Dim<[usize; 0]>>>>::Elem, ) -> Result<<ParamsBase<OwnedRepr<A>, Dim<[usize; 1]>> as Backward<ArrayBase<S, Dim<[usize; 1]>>, ArrayBase<T, Dim<[usize; 0]>>>>::Output, Error>

Source§

impl<A, S, T> Backward<ArrayBase<S, Dim<[usize; 1]>>, ArrayBase<T, Dim<[usize; 1]>>> for ParamsBase<OwnedRepr<A>>
where A: Float + FromPrimitive + ScalarOperand, S: Data<Elem = A>, T: Data<Elem = A>,

Source§

type Elem = A

Source§

type Output = A

Source§

fn backward( &mut self, input: &ArrayBase<S, Dim<[usize; 1]>>, delta: &ArrayBase<T, Dim<[usize; 1]>>, gamma: <ParamsBase<OwnedRepr<A>> as Backward<ArrayBase<S, Dim<[usize; 1]>>, ArrayBase<T, Dim<[usize; 1]>>>>::Elem, ) -> Result<<ParamsBase<OwnedRepr<A>> as Backward<ArrayBase<S, Dim<[usize; 1]>>, ArrayBase<T, Dim<[usize; 1]>>>>::Output, Error>

Source§

impl<A, S, T> Backward<ArrayBase<S, Dim<[usize; 2]>>, ArrayBase<T, Dim<[usize; 1]>>> for ParamsBase<OwnedRepr<A>, Dim<[usize; 1]>>
where A: Float + FromPrimitive + ScalarOperand, S: Data<Elem = A>, T: Data<Elem = A>,

Source§

type Elem = A

Source§

type Output = A

Source§

fn backward( &mut self, input: &ArrayBase<S, Dim<[usize; 2]>>, delta: &ArrayBase<T, Dim<[usize; 1]>>, gamma: <ParamsBase<OwnedRepr<A>, Dim<[usize; 1]>> as Backward<ArrayBase<S, Dim<[usize; 2]>>, ArrayBase<T, Dim<[usize; 1]>>>>::Elem, ) -> Result<<ParamsBase<OwnedRepr<A>, Dim<[usize; 1]>> as Backward<ArrayBase<S, Dim<[usize; 2]>>, ArrayBase<T, Dim<[usize; 1]>>>>::Output, Error>

Source§

impl<A, S, T> Backward<ArrayBase<S, Dim<[usize; 2]>>, ArrayBase<T, Dim<[usize; 2]>>> for ParamsBase<OwnedRepr<A>>
where A: Float + FromPrimitive + ScalarOperand, S: Data<Elem = A>, T: Data<Elem = A>,

Source§

type Elem = A

Source§

type Output = A

Source§

fn backward( &mut self, input: &ArrayBase<S, Dim<[usize; 2]>>, delta: &ArrayBase<T, Dim<[usize; 2]>>, gamma: <ParamsBase<OwnedRepr<A>> as Backward<ArrayBase<S, Dim<[usize; 2]>>, ArrayBase<T, Dim<[usize; 2]>>>>::Elem, ) -> Result<<ParamsBase<OwnedRepr<A>> as Backward<ArrayBase<S, Dim<[usize; 2]>>, ArrayBase<T, Dim<[usize; 2]>>>>::Output, Error>

Source§

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

Source§

fn bias(&self) -> &ArrayBase<S, <D as Dimension>::Smaller>

returns the bias of the model
Source§

fn bias_mut(&mut self) -> &mut ArrayBase<S, <D as Dimension>::Smaller>

returns a mutable reference to the bias of the model
Source§

fn assign_bias( &mut self, bias: &ArrayBase<S, <D as Dimension>::Smaller>, ) -> &mut Self
where S: DataMut, <S as RawData>::Elem: Clone,

assigns the given bias to the current bias
Source§

fn replace_bias( &mut self, bias: ArrayBase<S, <D as Dimension>::Smaller>, ) -> ArrayBase<S, <D as Dimension>::Smaller>

replaces the current bias with the given bias
Source§

fn set_bias( &mut self, bias: ArrayBase<S, <D as Dimension>::Smaller>, ) -> &mut Self

sets the bias of the model
Source§

fn iter_bias<'a>( &'a self, ) -> Iter<'a, <S as RawData>::Elem, <D as Dimension>::Smaller>
where S: Data + 'a, D: 'a,

returns an iterator over the bias
Source§

fn iter_bias_mut<'a>( &'a mut self, ) -> IterMut<'a, <S as RawData>::Elem, <D as Dimension>::Smaller>
where S: DataMut + 'a, D: 'a,

returns a mutable iterator over the bias
Source§

impl<A, S, D> Clone for ParamsBase<S, D>
where D: Dimension, S: RawDataClone<Elem = A>, A: Clone,

Source§

fn clone(&self) -> ParamsBase<S, D>

Returns a duplicate of the value. Read more
1.0.0 · Source§

const fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<A, S, D> Debug for ParamsBase<S, D>
where D: Dimension, S: Data<Elem = A>, A: Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<'a, A, S, D> Deserialize<'a> for ParamsBase<S, D>
where D: Dimension + Deserialize<'a>, S: DataOwned<Elem = A>, A: Deserialize<'a>, <D as Dimension>::Smaller: Deserialize<'a>,

Source§

fn deserialize<De>( deserializer: De, ) -> Result<ParamsBase<S, D>, <De as Deserializer<'a>>::Error>
where De: Deserializer<'a>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<A, S, D> Display for ParamsBase<S, D>
where D: Dimension, S: Data<Elem = A>, A: Display,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<A, X, Y, Z, S, D> Forward<X> for ParamsBase<S, D>
where A: Clone, D: Dimension, S: Data<Elem = A>, X: for<'a> Dot<ArrayBase<S, D>, Output = Y>, Y: for<'a> Add<&'a ArrayBase<S, <D as Dimension>::Smaller>, Output = Z>,

Source§

type Output = Z

Source§

fn forward( &self, input: &X, ) -> Result<<ParamsBase<S, D> as Forward<X>>::Output, Error>

a single forward step
Source§

fn forward_then<F>(&self, input: &Rhs, then: F) -> Result<Self::Output, Error>
where F: FnOnce(Self::Output) -> Self::Output,

this method enables the forward pass to be generically activated using some closure. This is useful for isolating the logic of the forward pass from that of the activation function and is often used by layers and models.
Source§

impl<A, S, D> IntoIterator for ParamsBase<S, D>
where D: Dimension, S: RawData<Elem = A>,

Source§

type Item = ParamsBase<S, D>

The type of the elements being iterated over.
Source§

type IntoIter = Once<ParamsBase<S, D>>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> <ParamsBase<S, D> as IntoIterator>::IntoIter

Creates an iterator from a value. Read more
Source§

impl<A, S, D> PartialEq<&ParamsBase<S, D>> for ParamsBase<S, D>
where D: Dimension, S: Data<Elem = A>, A: PartialEq,

Source§

fn eq(&self, other: &&ParamsBase<S, D>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

const fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<A, S, D> PartialEq<&mut ParamsBase<S, D>> for ParamsBase<S, D>
where D: Dimension, S: Data<Elem = A>, A: PartialEq,

Source§

fn eq(&self, other: &&mut ParamsBase<S, D>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

const fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<A, S, D> PartialEq for ParamsBase<S, D>
where D: Dimension, S: Data<Elem = A>, A: PartialEq,

Source§

fn eq(&self, other: &ParamsBase<S, D>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

const fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

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

Source§

fn count(&self) -> usize

Source§

impl<A, S, D> Serialize for ParamsBase<S, D>
where A: Serialize, D: Dimension + Serialize, S: Data<Elem = A>, <D as Dimension>::Smaller: Serialize,

Source§

fn serialize<Ser>( &self, serializer: Ser, ) -> Result<<Ser as Serializer>::Ok, <Ser as Serializer>::Error>
where Ser: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

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

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
Source§

fn assign_weights(&mut self, weights: &ArrayBase<S, D>) -> &mut Self
where S: DataMut, <S as RawData>::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 as RawData>::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 as RawData>::Elem, D>
where S: DataMut + 'a, D: 'a,

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

impl<A, S, D> Copy for ParamsBase<S, D>
where D: Dimension + Copy, <D as Dimension>::Smaller: Copy, S: RawDataClone<Elem = A> + Copy, A: Copy,

Source§

impl<A, S, D> Eq for ParamsBase<S, D>
where D: Dimension, S: Data<Elem = A>, A: Eq,

Source§

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

Auto Trait Implementations§

§

impl<S, D> Freeze for ParamsBase<S, D>
where S: Freeze, <D as Dimension>::Smaller: Freeze, D: Freeze,

§

impl<S, D> RefUnwindSafe for ParamsBase<S, D>

§

impl<S, D> Send for ParamsBase<S, D>
where S: Send + Data,

§

impl<S, D> Sync for ParamsBase<S, D>
where S: Sync + Data,

§

impl<S, D> Unpin for ParamsBase<S, D>
where S: Unpin, <D as Dimension>::Smaller: Unpin, D: Unpin,

§

impl<S, D> UnwindSafe for ParamsBase<S, D>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CallInPlace<T> for T
where T: CallInto<T>,

Source§

fn call_inplace<F>(&mut self, f: F) -> <T as CallInto<T>>::Output
where F: FnMut(&mut T) -> <T as CallInto<T>>::Output,

The call_on_mut method allows an object to be passed onto a function that takes a mutable reference to the object. This is useful for cases where you want to perform an operation on an object and mutate it in the process.
Source§

impl<T> CallInto<T> for T

Source§

type Output = T

Source§

fn call_into<F>(self, f: F) -> <T as CallInto<T>>::Output
where F: FnOnce(T) -> <T as CallInto<T>>::Output,

The call_into method allows an object to be passed into a function that takes ownership of the object. This is useful for cases where you want to perform an operation on an object and consume it in the process.
Source§

impl<T> CallOn<T> for T
where T: CallInto<T>,

Source§

fn call_on<F>(&self, f: F) -> <T as CallInto<T>>::Output
where F: FnMut(&T) -> <T as CallInto<T>>::Output,

The call_on method allows an object to be passed onto a function that takes a reference to the object. This is useful for cases where you want to perform an operation on an object without needing to extract it from a container or context.
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> ErrorKind for T
where T: Send + Sync + Debug + Display,

Source§

fn __private__(&self) -> Seal

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<K, S> Identity<K> for S
where S: Borrow<K>, K: Identifier,

Source§

type Item = S

Source§

fn get(&self) -> &<S as Identity<K>>::Item

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<M, U, V> Predict<U> for M
where M: Forward<U, Output = V>,

Source§

type Output = V

Source§

fn __private__(&self) -> Seal

Source§

fn predict(&self, input: &U) -> Result<<M as Predict<U>>::Output, ModelError>

Source§

impl<M, U, A, D> PredictWithConfidence<U> for M
where A: Float + FromPrimitive + ScalarOperand, D: Dimension, M: Predict<U, Output = ArrayBase<OwnedRepr<A>, D>>,

Source§

impl<Q> RawState for Q
where Q: Send + Sync + Debug,

Source§

fn __private__(&self) -> Seal

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,