pub struct ParamsBase<S, D = Ix2>{ /* 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>
impl<A, S, D> ParamsBase<S, D>
Sourcepub const fn new(
bias: ArrayBase<S, D::Smaller>,
weights: ArrayBase<S, D>,
) -> Self
pub const fn new( bias: ArrayBase<S, D::Smaller>, weights: ArrayBase<S, D>, ) -> Self
create a new instance of the ParamsBase
with the given bias and weights
Sourcepub fn init_from_fn<Sh, F>(shape: Sh, init: F) -> Self
pub fn init_from_fn<Sh, F>(shape: Sh, init: F) -> Self
returns a new instance of the ParamsBase
using the initialization routine
Sourcepub fn from_shape_fn<Sh, F>(shape: Sh, f: F) -> Self
pub fn from_shape_fn<Sh, F>(shape: Sh, f: F) -> Self
returns a new instance of the ParamsBase
initialized use the given shape_function
Sourcepub fn from_bias<Sh>(shape: Sh, bias: ArrayBase<S, D::Smaller>) -> Self
pub fn from_bias<Sh>(shape: Sh, bias: ArrayBase<S, D::Smaller>) -> Self
create a new instance of the ParamsBase
with the given bias used the default weights
Sourcepub fn from_weights<Sh>(shape: Sh, weights: ArrayBase<S, D>) -> Self
pub fn from_weights<Sh>(shape: Sh, weights: ArrayBase<S, D>) -> Self
create a new instance of the ParamsBase
with the given weights used the default
bias
Sourcepub fn from_elem<Sh>(shape: Sh, elem: A) -> Self
pub fn from_elem<Sh>(shape: Sh, elem: A) -> Self
create a new instance of the ParamsBase
from the given shape and element;
Sourcepub fn default<Sh>(shape: Sh) -> Self
pub fn default<Sh>(shape: Sh) -> Self
create an instance of the parameters with all values set to the default value
Sourcepub fn zeros<Sh>(shape: Sh) -> Self
pub fn zeros<Sh>(shape: Sh) -> Self
create an instance of the parameters with all values set to zero
Sourcepub const fn bias(&self) -> &ArrayBase<S, D::Smaller>
pub const fn bias(&self) -> &ArrayBase<S, D::Smaller>
returns an immutable reference to the bias
Sourcepub const fn bias_mut(&mut self) -> &mut ArrayBase<S, D::Smaller>
pub const fn bias_mut(&mut self) -> &mut ArrayBase<S, D::Smaller>
returns a mutable reference to the bias
Sourcepub const fn weights_mut(&mut self) -> &mut ArrayBase<S, D>
pub const fn weights_mut(&mut self) -> &mut ArrayBase<S, D>
returns a mutable reference to the weights
Sourcepub fn assign_bias(&mut self, bias: &ArrayBase<S, D::Smaller>) -> &mut Self
pub fn assign_bias(&mut self, bias: &ArrayBase<S, D::Smaller>) -> &mut Self
assign the bias
Sourcepub fn assign_weights(&mut self, weights: &ArrayBase<S, D>) -> &mut Self
pub fn assign_weights(&mut self, weights: &ArrayBase<S, D>) -> &mut Self
assign the weights
Sourcepub fn replace_bias(
&mut self,
bias: ArrayBase<S, D::Smaller>,
) -> ArrayBase<S, D::Smaller>
pub fn replace_bias( &mut self, bias: ArrayBase<S, D::Smaller>, ) -> ArrayBase<S, D::Smaller>
replace the bias and return the previous state; uses replace
Sourcepub fn replace_weights(&mut self, weights: ArrayBase<S, D>) -> ArrayBase<S, D>
pub fn replace_weights(&mut self, weights: ArrayBase<S, D>) -> ArrayBase<S, D>
replace the weights and return the previous state; uses replace
Sourcepub fn set_weights(&mut self, weights: ArrayBase<S, D>) -> &mut Self
pub fn set_weights(&mut self, weights: ArrayBase<S, D>) -> &mut Self
set the weights
Sourcepub fn backward<X, Y, Z>(&mut self, input: &X, grad: &Y, lr: A) -> Result<Z>
pub fn backward<X, Y, Z>(&mut self, input: &X, grad: &Y, lr: A) -> Result<Z>
perform a single backpropagation step
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
returns true if both the weights and bias are empty; uses is_empty
Sourcepub fn is_weights_empty(&self) -> bool
pub fn is_weights_empty(&self) -> bool
returns true if the weights are empty
Sourcepub fn is_bias_empty(&self) -> bool
pub fn is_bias_empty(&self) -> bool
returns true if the bias is empty
Sourcepub fn count_weight(&self) -> usize
pub fn count_weight(&self) -> usize
the total number of elements within the weight tensor
Sourcepub fn count_bias(&self) -> usize
pub fn count_bias(&self) -> usize
the total number of elements within the bias tensor
Sourcepub fn shape(&self) -> &[usize]
pub fn shape(&self) -> &[usize]
returns the shape of the parameters; uses the shape of the weight tensor
Sourcepub fn shape_bias(&self) -> &[usize]
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
Sourcepub fn to_owned(&self) -> ParamsBase<OwnedRepr<A>, D>
pub fn to_owned(&self) -> ParamsBase<OwnedRepr<A>, D>
returns an owned instance of the parameters
Sourcepub fn to_shape<Sh>(
&self,
shape: Sh,
) -> Result<ParamsBase<CowRepr<'_, A>, Sh::Dim>>
pub fn to_shape<Sh>( &self, shape: Sh, ) -> Result<ParamsBase<CowRepr<'_, A>, Sh::Dim>>
change the shape of the parameters; the shape of the bias parameters is determined by removing the “zero-th” axis of the given shape
returns a new ParamsBase
instance with the same paramaters, but using a shared
representation of the data;
Source§impl<A, S> ParamsBase<S, Ix1>where
S: RawData<Elem = A>,
impl<A, S> ParamsBase<S, Ix1>where
S: RawData<Elem = A>,
Sourcepub fn from_scalar_bias(bias: A, weights: ArrayBase<S, Ix1>) -> Self
pub fn from_scalar_bias(bias: A, weights: ArrayBase<S, Ix1>) -> Self
returns a new instance of the ParamsBase
initialized using a scalar bias along
with the given, one-dimensional weight tensor.
Source§impl<A, S> ParamsBase<S, Ix2>where
S: RawData<Elem = A>,
impl<A, S> ParamsBase<S, Ix2>where
S: RawData<Elem = A>,
Source§impl<A, S, D> ParamsBase<S, D>
impl<A, S, D> ParamsBase<S, D>
Sourcepub fn init_rand<G, Dst, Sh>(shape: Sh, distr: G) -> Selfwhere
D: RemoveAxis,
S: DataOwned,
Sh: ShapeBuilder<Dim = D>,
Dst: Clone + Distribution<A>,
G: Fn(&Sh) -> Dst,
pub fn init_rand<G, Dst, Sh>(shape: Sh, distr: G) -> Selfwhere
D: RemoveAxis,
S: DataOwned,
Sh: ShapeBuilder<Dim = D>,
Dst: Clone + Distribution<A>,
G: Fn(&Sh) -> Dst,
generates a randomly initialized set of parameters with the given shape using the
output of the given distribution function G
Source§impl<S, D, A> ParamsBase<S, D>
Here, we implement various iterators for the parameters and its constituents. The core
iterators are:
impl<S, D, A> ParamsBase<S, D>
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;
Sourcepub fn iter(&self) -> Iter<'_, A, D> ⓘwhere
D: RemoveAxis,
S: Data,
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
Sourcepub fn iter_mut(&mut self) -> IterMut<'_, A, D> ⓘwhere
D: RemoveAxis,
S: DataMut,
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
Sourcepub fn iter_bias(&self) -> Iter<'_, A, D::Smaller>where
S: Data,
pub fn iter_bias(&self) -> Iter<'_, A, D::Smaller>where
S: Data,
returns an iterator over the bias
Sourcepub fn iter_bias_mut(&mut self) -> IterMut<'_, A, D::Smaller>where
S: DataMut,
pub fn iter_bias_mut(&mut self) -> IterMut<'_, A, D::Smaller>where
S: DataMut,
returns a mutable iterator over the bias
Sourcepub fn iter_weights(&self) -> Iter<'_, A, D>where
S: Data,
pub fn iter_weights(&self) -> Iter<'_, A, D>where
S: Data,
returns an iterator over the weights
Sourcepub fn iter_weights_mut(&mut self) -> IterMut<'_, A, D>where
S: DataMut,
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>
impl<A, S, D> ParamsBase<S, D>
Sourcepub fn apply_gradient<Delta, Z>(&mut self, grad: &Delta, lr: A) -> Result<Z>where
S: DataMut,
Self: ApplyGradient<Delta, A, Output = Z>,
pub fn apply_gradient<Delta, Z>(&mut self, grad: &Delta, lr: A) -> Result<Z>where
S: DataMut,
Self: ApplyGradient<Delta, A, Output = Z>,
a convenience method used to apply a gradient to the parameters using the given learning rate.
pub fn apply_gradient_with_decay<Grad, Z>(
&mut self,
grad: &Grad,
lr: A,
decay: A,
) -> Result<Z>where
S: DataMut,
Self: ApplyGradient<Grad, A, Output = Z>,
pub fn apply_gradient_with_momentum<Grad, V, Z>(
&mut self,
grad: &Grad,
lr: A,
momentum: A,
velocity: &mut V,
) -> Result<Z>where
S: DataMut,
Self: ApplyGradientExt<Grad, A, Output = Z, Velocity = V>,
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>where
S: DataMut,
Self: ApplyGradientExt<Grad, A, Output = Z, Velocity = V>,
Source§impl<A, S, D> ParamsBase<S, D>
impl<A, S, D> ParamsBase<S, D>
Sourcepub fn random_with<Dst, Sh>(shape: Sh, distr: Dst) -> Self
pub fn random_with<Dst, Sh>(shape: Sh, distr: Dst) -> Self
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,
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,
type Output = ()
fn apply_gradient( &mut self, grad: &ParamsBase<T, D>, lr: A, ) -> Result<Self::Output>
fn apply_gradient_with_decay( &mut self, grad: &ParamsBase<T, D>, lr: A, decay: A, ) -> Result<Self::Output>
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,
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,
type Velocity = ParamsBase<OwnedRepr<A>, D>
fn apply_gradient_with_momentum( &mut self, grad: &ParamsBase<T, D>, lr: A, momentum: A, velocity: &mut Self::Velocity, ) -> Result<()>
fn apply_gradient_with_decay_and_momentum( &mut self, grad: &ParamsBase<T, D>, lr: A, decay: A, momentum: A, velocity: &mut Self::Velocity, ) -> Result<()>
Source§impl<S, D> Biased<S, D> for ParamsBase<S, D>
impl<S, D> Biased<S, D> for ParamsBase<S, D>
Source§fn bias_mut(&mut self) -> &mut ArrayBase<S, D::Smaller>
fn bias_mut(&mut self) -> &mut ArrayBase<S, D::Smaller>
Source§fn assign_bias(&mut self, bias: &ArrayBase<S, D::Smaller>) -> &mut Self
fn assign_bias(&mut self, bias: &ArrayBase<S, D::Smaller>) -> &mut Self
Source§fn replace_bias(
&mut self,
bias: ArrayBase<S, D::Smaller>,
) -> ArrayBase<S, D::Smaller>
fn replace_bias( &mut self, bias: ArrayBase<S, D::Smaller>, ) -> ArrayBase<S, D::Smaller>
Source§fn set_bias(&mut self, bias: ArrayBase<S, D::Smaller>) -> &mut Self
fn set_bias(&mut self, bias: ArrayBase<S, D::Smaller>) -> &mut Self
Source§impl<A, S, D> Clone for ParamsBase<S, D>
impl<A, S, D> Clone for ParamsBase<S, D>
Source§impl<A, S, D> Debug for ParamsBase<S, D>
impl<A, S, D> Debug for ParamsBase<S, D>
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>,
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<Self, De::Error>where
De: Deserializer<'a>,
fn deserialize<De>(deserializer: De) -> Result<Self, De::Error>where
De: Deserializer<'a>,
Source§impl<A, S, D> Display for ParamsBase<S, D>
impl<A, S, D> Display for ParamsBase<S, D>
Source§impl<A, X, Y, Z, S, D> Forward<X> for ParamsBase<S, D>
impl<A, X, Y, Z, S, D> Forward<X> for ParamsBase<S, D>
type Output = Z
Source§impl<A, S, D> Initialize<S, D> for ParamsBase<S, D>where
D: RemoveAxis,
S: RawData<Elem = A>,
impl<A, S, D> Initialize<S, D> for ParamsBase<S, D>where
D: RemoveAxis,
S: RawData<Elem = A>,
fn rand<Sh, Ds>(shape: Sh, distr: Ds) -> Self
fn rand_with<Sh, Ds, R>(shape: Sh, distr: Ds, rng: &mut R) -> Self
fn bernoulli<Sh>(shape: Sh, p: f64) -> Result<Self, BernoulliError>
Source§fn glorot_normal<Sh>(shape: Sh) -> Selfwhere
Sh: ShapeBuilder<Dim = D>,
StandardNormal: Distribution<<S as RawData>::Elem>,
S: DataOwned,
<S as RawData>::Elem: Float + FromPrimitive,
fn glorot_normal<Sh>(shape: Sh) -> Selfwhere
Sh: ShapeBuilder<Dim = D>,
StandardNormal: Distribution<<S as RawData>::Elem>,
S: DataOwned,
<S as RawData>::Elem: Float + FromPrimitive,
Source§fn glorot_uniform<Sh>(shape: Sh) -> Result<Self, InitError>where
S: DataOwned,
Sh: ShapeBuilder<Dim = D>,
<S as RawData>::Elem: Float + FromPrimitive + SampleUniform,
<<S as RawData>::Elem as SampleUniform>::Sampler: Clone,
fn glorot_uniform<Sh>(shape: Sh) -> Result<Self, InitError>where
S: DataOwned,
Sh: ShapeBuilder<Dim = D>,
<S as RawData>::Elem: Float + FromPrimitive + SampleUniform,
<<S as RawData>::Elem as SampleUniform>::Sampler: Clone,
Source§fn lecun_normal<Sh>(shape: Sh) -> Selfwhere
StandardNormal: Distribution<<S as RawData>::Elem>,
S: DataOwned,
Sh: ShapeBuilder<Dim = D>,
<S as RawData>::Elem: Float,
fn lecun_normal<Sh>(shape: Sh) -> Selfwhere
StandardNormal: Distribution<<S as RawData>::Elem>,
S: DataOwned,
Sh: ShapeBuilder<Dim = D>,
<S as RawData>::Elem: Float,
Source§fn normal<Sh>(
shape: Sh,
mean: <S as RawData>::Elem,
std: <S as RawData>::Elem,
) -> Result<Self, Error>where
StandardNormal: Distribution<<S as RawData>::Elem>,
S: DataOwned,
Sh: ShapeBuilder<Dim = D>,
<S as RawData>::Elem: Float,
fn normal<Sh>(
shape: Sh,
mean: <S as RawData>::Elem,
std: <S as RawData>::Elem,
) -> Result<Self, Error>where
StandardNormal: Distribution<<S as RawData>::Elem>,
S: DataOwned,
Sh: ShapeBuilder<Dim = D>,
<S as RawData>::Elem: Float,
fn randc<Sh>(
shape: Sh,
re: <S as RawData>::Elem,
im: <S as RawData>::Elem,
) -> Selfwhere
S: DataOwned,
Sh: ShapeBuilder<Dim = D>,
ComplexDistribution<<S as RawData>::Elem>: Distribution<<S as RawData>::Elem>,
Source§fn stdnorm<Sh>(shape: Sh) -> Self
fn stdnorm<Sh>(shape: Sh) -> Self
Source§fn stdnorm_from_seed<Sh>(shape: Sh, seed: u64) -> Self
fn stdnorm_from_seed<Sh>(shape: Sh, seed: u64) -> Self
StandardNormal
distribution with a given seedSource§fn truncnorm<Sh>(
shape: Sh,
mean: <S as RawData>::Elem,
std: <S as RawData>::Elem,
) -> Result<Self, InitError>where
StandardNormal: Distribution<<S as RawData>::Elem>,
S: DataOwned,
Sh: ShapeBuilder<Dim = D>,
<S as RawData>::Elem: Float,
fn truncnorm<Sh>(
shape: Sh,
mean: <S as RawData>::Elem,
std: <S as RawData>::Elem,
) -> Result<Self, InitError>where
StandardNormal: Distribution<<S as RawData>::Elem>,
S: DataOwned,
Sh: ShapeBuilder<Dim = D>,
<S as RawData>::Elem: Float,
TruncatedNormal
distributionSource§fn uniform<Sh>(shape: Sh, dk: <S as RawData>::Elem) -> Result<Self, InitError>where
S: DataOwned,
Sh: ShapeBuilder<Dim = D>,
<S as RawData>::Elem: Clone + Neg<Output = <S as RawData>::Elem> + SampleUniform,
<<S as RawData>::Elem as SampleUniform>::Sampler: Clone,
fn uniform<Sh>(shape: Sh, dk: <S as RawData>::Elem) -> Result<Self, InitError>where
S: DataOwned,
Sh: ShapeBuilder<Dim = D>,
<S as RawData>::Elem: Clone + Neg<Output = <S as RawData>::Elem> + SampleUniform,
<<S as RawData>::Elem as SampleUniform>::Sampler: Clone,
Uniform
distribution with values bounded by +/- dk
Source§fn uniform_from_seed<Sh>(
shape: Sh,
start: <S as RawData>::Elem,
stop: <S as RawData>::Elem,
key: u64,
) -> Result<Self, InitError>where
S: DataOwned,
Sh: ShapeBuilder<Dim = D>,
<S as RawData>::Elem: Clone + SampleUniform,
<<S as RawData>::Elem as SampleUniform>::Sampler: Clone,
fn uniform_from_seed<Sh>(
shape: Sh,
start: <S as RawData>::Elem,
stop: <S as RawData>::Elem,
key: u64,
) -> Result<Self, InitError>where
S: DataOwned,
Sh: ShapeBuilder<Dim = D>,
<S as RawData>::Elem: Clone + SampleUniform,
<<S as RawData>::Elem as SampleUniform>::Sampler: Clone,
Uniform
distribution with values between
the start
and stop
params using some random seed.Source§fn uniform_along<Sh>(shape: Sh, axis: usize) -> Result<Self, InitError>where
Sh: ShapeBuilder<Dim = D>,
S: DataOwned,
<S as RawData>::Elem: Float + FromPrimitive + SampleUniform,
<<S as RawData>::Elem as SampleUniform>::Sampler: Clone,
fn uniform_along<Sh>(shape: Sh, axis: usize) -> Result<Self, InitError>where
Sh: ShapeBuilder<Dim = D>,
S: DataOwned,
<S as RawData>::Elem: Float + FromPrimitive + SampleUniform,
<<S as RawData>::Elem as SampleUniform>::Sampler: Clone,
Uniform
distribution with values bounded by the
size of the specified axis.
The values are bounded by +/- dk
where dk = 1 / size(axis)
.Source§fn uniform_between<Sh>(
shape: Sh,
a: <S as RawData>::Elem,
b: <S as RawData>::Elem,
) -> Result<Self, InitError>where
Sh: ShapeBuilder<Dim = D>,
S: DataOwned,
<S as RawData>::Elem: Clone + SampleUniform,
<<S as RawData>::Elem as SampleUniform>::Sampler: Clone,
fn uniform_between<Sh>(
shape: Sh,
a: <S as RawData>::Elem,
b: <S as RawData>::Elem,
) -> Result<Self, InitError>where
Sh: ShapeBuilder<Dim = D>,
S: DataOwned,
<S as RawData>::Elem: Clone + SampleUniform,
<<S as RawData>::Elem as SampleUniform>::Sampler: Clone,
Uniform
distribution with values between then given
bounds, a
and b
.Source§impl<A, S, D> IntoIterator for ParamsBase<S, D>
impl<A, S, D> IntoIterator for ParamsBase<S, D>
Source§impl<A, S, D> PartialEq<&ParamsBase<S, D>> for ParamsBase<S, D>
impl<A, S, D> PartialEq<&ParamsBase<S, D>> for ParamsBase<S, D>
Source§impl<A, S, D> PartialEq<&mut ParamsBase<S, D>> for ParamsBase<S, D>
impl<A, S, D> PartialEq<&mut ParamsBase<S, D>> for ParamsBase<S, D>
Source§impl<A, S, D> PartialEq for ParamsBase<S, D>
impl<A, S, D> PartialEq for ParamsBase<S, D>
Source§impl<A, S, D> Serialize for ParamsBase<S, D>
impl<A, S, D> Serialize for ParamsBase<S, D>
Source§impl<S, D> Weighted<S, D> for ParamsBase<S, D>
impl<S, D> Weighted<S, D> for ParamsBase<S, D>
Source§fn weights_mut(&mut self) -> &mut ArrayBase<S, D>
fn weights_mut(&mut self) -> &mut ArrayBase<S, D>
Source§fn assign_weights(&mut self, weights: &ArrayBase<S, D>) -> &mut Self
fn assign_weights(&mut self, weights: &ArrayBase<S, D>) -> &mut Self
Source§fn replace_weights(&mut self, weights: ArrayBase<S, D>) -> ArrayBase<S, D>
fn replace_weights(&mut self, weights: ArrayBase<S, D>) -> ArrayBase<S, D>
Source§fn set_weights(&mut self, weights: ArrayBase<S, D>) -> &mut Self
fn set_weights(&mut self, weights: ArrayBase<S, D>) -> &mut Self
impl<A, S, D> Copy for ParamsBase<S, D>
impl<A, S, D> Eq for ParamsBase<S, D>
Auto Trait Implementations§
impl<S, D> Freeze for ParamsBase<S, D>
impl<S, D> RefUnwindSafe for ParamsBase<S, D>where
S: RefUnwindSafe,
<D as Dimension>::Smaller: RefUnwindSafe,
D: RefUnwindSafe,
<S as RawData>::Elem: RefUnwindSafe,
impl<S, D> Send for ParamsBase<S, D>
impl<S, D> Sync for ParamsBase<S, D>
impl<S, D> Unpin for ParamsBase<S, D>
impl<S, D> UnwindSafe for ParamsBase<S, D>where
S: UnwindSafe,
<D as Dimension>::Smaller: UnwindSafe,
D: UnwindSafe,
<S as RawData>::Elem: RefUnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CallInPlace<T> for Twhere
T: CallInto<T>,
impl<T> CallInPlace<T> for Twhere
T: CallInto<T>,
Source§fn call_inplace<F>(&mut self, f: F) -> <T as CallInto<T>>::Output
fn call_inplace<F>(&mut self, f: F) -> <T as CallInto<T>>::Output
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
impl<T> CallInto<T> for T
Source§impl<T> CallOn<T> for Twhere
T: CallInto<T>,
impl<T> CallOn<T> for Twhere
T: CallInto<T>,
Source§fn call_on<F>(&self, f: F) -> <T as CallInto<T>>::Output
fn call_on<F>(&self, f: F) -> <T as CallInto<T>>::Output
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.