pub struct ParamsBase<S, D = Dim<[usize; 2]>, A = <S as RawData>::Elem>{
pub bias: ArrayBase<S, <D as Dimension>::Smaller, A>,
pub weights: ArrayBase<S, D, A>,
}Expand description
The ParamsBase implementation aims to provide a generic, n-dimensional weight and bias
pair for a model (or layer). The object requires the bias tensor to be a single dimension
smaller than the weights tensor.
Therefore, we allow the weight tensor to be the shape of the parameters, using the shape
as the basis for the bias tensor by removing the first axis.
Consequently, this constrains the ParamsBase implementation to only support dimensions
that can be reduced by one axis, typically the “zero-th” axis: $\text{rank}(D)$.
Fields§
§bias: ArrayBase<S, <D as Dimension>::Smaller, A>§weights: ArrayBase<S, D, A>Implementations§
Source§impl<A, S, D> ParamsBase<S, D, A>
impl<A, S, D> ParamsBase<S, D, A>
Sourcepub const fn new(
bias: ArrayBase<S, <D as Dimension>::Smaller, A>,
weights: ArrayBase<S, D, A>,
) -> ParamsBase<S, D, A>
pub const fn new( bias: ArrayBase<S, <D as Dimension>::Smaller, A>, weights: ArrayBase<S, D, A>, ) -> ParamsBase<S, D, A>
create a new instance of the ParamsBase with the given bias and weights
Sourcepub fn init_from_fn<Sh, F>(shape: Sh, init: F) -> ParamsBase<S, D, A>
pub fn init_from_fn<Sh, F>(shape: Sh, init: F) -> ParamsBase<S, D, A>
returns a new instance of the ParamsBase using the initialization routine
Sourcepub fn from_shape_fn<Sh, F1, F2>(shape: Sh, w: F1, b: F2) -> ParamsBase<S, D, A>
pub fn from_shape_fn<Sh, F1, F2>(shape: Sh, w: F1, b: F2) -> ParamsBase<S, D, A>
returns a new instance of the ParamsBase initialized use the given shape_function
Sourcepub fn from_bias<Sh>(
shape: Sh,
bias: ArrayBase<S, <D as Dimension>::Smaller, A>,
) -> ParamsBase<S, D, A>
pub fn from_bias<Sh>( shape: Sh, bias: ArrayBase<S, <D as Dimension>::Smaller, A>, ) -> ParamsBase<S, D, A>
create a new instance of the ParamsBase with the given bias used the default weights
Sourcepub fn from_weights(weights: ArrayBase<S, D, A>) -> ParamsBase<S, D, A>
pub fn from_weights(weights: ArrayBase<S, D, A>) -> ParamsBase<S, D, A>
create a new instance of the ParamsBase with the given weights used the default
bias
Sourcepub fn from_elem<Sh>(shape: Sh, elem: A) -> ParamsBase<S, D, A>
pub fn from_elem<Sh>(shape: Sh, elem: A) -> ParamsBase<S, D, A>
create a new instance of the ParamsBase from the given shape and element;
Sourcepub fn default<Sh>(shape: Sh) -> ParamsBase<S, D, A>
pub fn default<Sh>(shape: Sh) -> ParamsBase<S, D, A>
create an instance of the parameters with all values set to the default value
Sourcepub fn ones<Sh>(shape: Sh) -> ParamsBase<S, D, A>
pub fn ones<Sh>(shape: Sh) -> ParamsBase<S, D, A>
initialize the parameters with all values set to zero
Sourcepub fn zeros<Sh>(shape: Sh) -> ParamsBase<S, D, A>
pub fn zeros<Sh>(shape: Sh) -> ParamsBase<S, D, A>
create an instance of the parameters with all values set to zero
Sourcepub const fn bias(&self) -> &ArrayBase<S, <D as Dimension>::Smaller, A>
pub const fn bias(&self) -> &ArrayBase<S, <D as Dimension>::Smaller, A>
returns an immutable reference to the bias
Sourcepub const fn bias_mut(
&mut self,
) -> &mut ArrayBase<S, <D as Dimension>::Smaller, A>
pub const fn bias_mut( &mut self, ) -> &mut ArrayBase<S, <D as Dimension>::Smaller, A>
returns a mutable reference to the bias
Sourcepub const fn weights(&self) -> &ArrayBase<S, D, A>
pub const fn weights(&self) -> &ArrayBase<S, D, A>
returns an immutable reference to the weights
Sourcepub const fn weights_mut(&mut self) -> &mut ArrayBase<S, D, A>
pub const fn weights_mut(&mut self) -> &mut ArrayBase<S, D, A>
returns a mutable reference to the weights
Sourcepub fn bias_as_raw_ref(&self) -> &RawRef<A, <D as Dimension>::Smaller>where
S: Data,
pub fn bias_as_raw_ref(&self) -> &RawRef<A, <D as Dimension>::Smaller>where
S: Data,
returns a raw reference to the bias tensor
Sourcepub fn weights_as_raw_ref(&self) -> &RawRef<A, D>where
S: Data,
pub fn weights_as_raw_ref(&self) -> &RawRef<A, D>where
S: Data,
returns a raw reference of the weights
Sourcepub fn bias_layout_ref(&self) -> &LayoutRef<A, <D as Dimension>::Smaller>where
S: Data,
pub fn bias_layout_ref(&self) -> &LayoutRef<A, <D as Dimension>::Smaller>where
S: Data,
returns an immutable rererence to the bias as a layout reference
Sourcepub fn bias_layout_ref_mut(
&mut self,
) -> &mut LayoutRef<A, <D as Dimension>::Smaller>where
S: DataMut,
pub fn bias_layout_ref_mut(
&mut self,
) -> &mut LayoutRef<A, <D as Dimension>::Smaller>where
S: DataMut,
returns a mutable rererence to the weights as a layout reference
Sourcepub fn weights_layout_ref(&self) -> &LayoutRef<A, D>where
S: Data,
pub fn weights_layout_ref(&self) -> &LayoutRef<A, D>where
S: Data,
returns an immutable rererence to the weights as a layout reference
Sourcepub fn weights_layout_ref_mut(&mut self) -> &mut LayoutRef<A, D>where
S: DataMut,
pub fn weights_layout_ref_mut(&mut self) -> &mut LayoutRef<A, D>where
S: DataMut,
returns a mutable rererence to the weights as a layout reference
Sourcepub fn assign_bias(
&mut self,
bias: &ArrayBase<S, <D as Dimension>::Smaller, A>,
) -> &mut ParamsBase<S, D, A>
pub fn assign_bias( &mut self, bias: &ArrayBase<S, <D as Dimension>::Smaller, A>, ) -> &mut ParamsBase<S, D, A>
assign the bias
Sourcepub fn assign_weights(
&mut self,
weights: &ArrayBase<S, D, A>,
) -> &mut ParamsBase<S, D, A>
pub fn assign_weights( &mut self, weights: &ArrayBase<S, D, A>, ) -> &mut ParamsBase<S, D, A>
assign the weights
Sourcepub fn replace_bias(
&mut self,
bias: ArrayBase<S, <D as Dimension>::Smaller, A>,
) -> ArrayBase<S, <D as Dimension>::Smaller, A>
pub fn replace_bias( &mut self, bias: ArrayBase<S, <D as Dimension>::Smaller, A>, ) -> ArrayBase<S, <D as Dimension>::Smaller, A>
replace the bias and return the previous state; uses replace
Sourcepub fn replace_weights(
&mut self,
weights: ArrayBase<S, D, A>,
) -> ArrayBase<S, D, A>
pub fn replace_weights( &mut self, weights: ArrayBase<S, D, A>, ) -> ArrayBase<S, D, A>
replace the weights and return the previous state; uses replace
Sourcepub fn set_bias(
&mut self,
bias: ArrayBase<S, <D as Dimension>::Smaller, A>,
) -> &mut ParamsBase<S, D, A>
pub fn set_bias( &mut self, bias: ArrayBase<S, <D as Dimension>::Smaller, A>, ) -> &mut ParamsBase<S, D, A>
set the bias
Sourcepub fn set_weights(
&mut self,
weights: ArrayBase<S, D, A>,
) -> &mut ParamsBase<S, D, A>
pub fn set_weights( &mut self, weights: ArrayBase<S, D, A>, ) -> &mut ParamsBase<S, D, A>
set the weights
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_weights(&self) -> usize
pub fn count_weights(&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<'a>(&'a self) -> &'a [usize]where
A: 'a,
pub fn shape<'a>(&'a self) -> &'a [usize]where
A: 'a,
returns the shape of the parameters; uses the shape of the weight tensor
Sourcepub fn shape_bias(&self) -> &[usize]where
A: 'static,
pub fn shape_bias(&self) -> &[usize]where
A: 'static,
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, A>
pub fn to_owned(&self) -> ParamsBase<OwnedRepr<A>, D, A>
returns an owned instance of the parameters
Sourcepub fn to_shape<Sh>(
&self,
shape: Sh,
) -> Result<ParamsBase<CowRepr<'_, A>, <Sh as ShapeBuilder>::Dim>, ParamsError>where
A: Clone,
S: DataOwned,
Sh: ShapeBuilder<Dim = D>,
<Sh as ShapeBuilder>::Dim: Dimension + RemoveAxis,
pub fn to_shape<Sh>(
&self,
shape: Sh,
) -> Result<ParamsBase<CowRepr<'_, A>, <Sh as ShapeBuilder>::Dim>, ParamsError>where
A: Clone,
S: DataOwned,
Sh: ShapeBuilder<Dim = D>,
<Sh as ShapeBuilder>::Dim: Dimension + RemoveAxis,
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;
Sourcepub fn view(&self) -> ParamsBase<ViewRepr<&A>, D>where
S: Data,
pub fn view(&self) -> ParamsBase<ViewRepr<&A>, D>where
S: Data,
returns a “view” of the parameters; see view for more information
Sourcepub fn view_mut(&mut self) -> ParamsBase<ViewRepr<&mut A>, D>where
S: DataMut,
pub fn view_mut(&mut self) -> ParamsBase<ViewRepr<&mut A>, D>where
S: DataMut,
returns mutable view of the parameters
Sourcepub fn clamp(&mut self, min: A, max: A) -> ParamsBase<OwnedRepr<A>, D, A>
pub fn clamp(&mut self, min: A, max: A) -> ParamsBase<OwnedRepr<A>, D, A>
clamps all values within the parameters between the given min and max values
Source§impl<A, S, D> ParamsBase<S, D, A>
Here, we implement various iterators for the parameters and its constituents. The core
iterators are:
impl<A, S, D> ParamsBase<S, D, A>
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) -> ParamsIter<'_, A, D> ⓘwhere
D: RemoveAxis,
S: Data,
pub fn iter(&self) -> ParamsIter<'_, 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) -> ParamsIterMut<'_, A, D> ⓘwhere
D: RemoveAxis,
S: DataMut,
pub fn iter_mut(&mut self) -> ParamsIterMut<'_, 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 as Dimension>::Smaller>where
S: Data,
pub fn iter_bias(&self) -> Iter<'_, A, <D as Dimension>::Smaller>where
S: Data,
returns an iterator over the bias
Sourcepub fn iter_bias_mut(&mut self) -> IterMut<'_, A, <D as Dimension>::Smaller>where
S: DataMut,
pub fn iter_bias_mut(&mut self) -> IterMut<'_, A, <D as Dimension>::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
Sourcepub fn axis_iter_weights(
&self,
axis: Axis,
) -> AxisIter<'_, A, <D as Dimension>::Smaller>where
D: RemoveAxis,
S: Data,
pub fn axis_iter_weights(
&self,
axis: Axis,
) -> AxisIter<'_, A, <D as Dimension>::Smaller>where
D: RemoveAxis,
S: Data,
returns an iterator over the weights along the specified axis
Sourcepub fn axis_iter_weights_mut(
&mut self,
axis: Axis,
) -> AxisIterMut<'_, A, <D as Dimension>::Smaller>where
D: RemoveAxis,
S: DataMut,
pub fn axis_iter_weights_mut(
&mut self,
axis: Axis,
) -> AxisIterMut<'_, A, <D as Dimension>::Smaller>where
D: RemoveAxis,
S: DataMut,
returns a mutable iterator over the weights along the specified axis
Source§impl<S, D, A> ParamsBase<S, D, A>
impl<S, D, A> ParamsBase<S, D, A>
pub fn cos(&self) -> ParamsBase<OwnedRepr<A>, D, A>where
A: Float,
pub fn cosh(&self) -> ParamsBase<OwnedRepr<A>, D, A>where
A: Float,
pub fn exp(&self) -> ParamsBase<OwnedRepr<A>, D, A>where
A: Float,
pub fn ln(&self) -> ParamsBase<OwnedRepr<A>, D, A>where
A: Float,
pub fn sin(&self) -> ParamsBase<OwnedRepr<A>, D, A>where
A: Float,
pub fn sinh(&self) -> ParamsBase<OwnedRepr<A>, D, A>where
A: Float,
pub fn sqrt(&self) -> ParamsBase<OwnedRepr<A>, D, A>where
A: Float,
pub fn tan(&self) -> ParamsBase<OwnedRepr<A>, D, A>where
A: Float,
pub fn tanh(&self) -> ParamsBase<OwnedRepr<A>, D, A>where
A: Float,
Sourcepub fn abs(&self) -> ParamsBase<OwnedRepr<A>, D, A>where
A: Signed,
pub fn abs(&self) -> ParamsBase<OwnedRepr<A>, D, A>where
A: Signed,
take the absolute value of each element within the parameters
Source§impl<A, S, D> ParamsBase<S, D, A>
impl<A, S, D> ParamsBase<S, D, A>
Sourcepub fn backward<X, Y>(&mut self, input: &X, grad: &Y, lr: A)where
ParamsBase<S, D, A>: Backward<X, Y, Elem = A>,
pub fn backward<X, Y>(&mut self, input: &X, grad: &Y, lr: A)where
ParamsBase<S, D, A>: Backward<X, Y, Elem = A>,
execute a single backward propagation
Sourcepub fn forward<X, Y>(&self, input: &X) -> Ywhere
ParamsBase<S, D, A>: Forward<X, Output = Y>,
pub fn forward<X, Y>(&self, input: &X) -> Ywhere
ParamsBase<S, D, A>: Forward<X, Output = Y>,
invoke a single forward step; this method is simply a convienience method implemented
to reduce the number of Forward imports.
Source§impl<A, S, D> ParamsBase<S, D, A>
impl<A, S, D> ParamsBase<S, D, A>
Source§impl<A, S> ParamsBase<S, Dim<[usize; 1]>>where
S: RawData<Elem = A>,
impl<A, S> ParamsBase<S, Dim<[usize; 1]>>where
S: RawData<Elem = A>,
Sourcepub fn from_scalar_bias(
bias: A,
weights: ArrayBase<S, Dim<[usize; 1]>>,
) -> ParamsBase<S, Dim<[usize; 1]>>
pub fn from_scalar_bias( bias: A, weights: ArrayBase<S, Dim<[usize; 1]>>, ) -> ParamsBase<S, Dim<[usize; 1]>>
returns a new instance of the ParamsBase initialized using a scalar bias along
with the given, one-dimensional weight tensor.
Methods from Deref<Target = LayoutRef<<S as RawData>::Elem, D>>§
Sourcepub fn len_of(&self, axis: Axis) -> usize
pub fn len_of(&self, axis: Axis) -> usize
Return the length of axis.
The axis should be in the range Axis( 0 .. n ) where n is the
number of dimensions (axes) of the array.
Panics if the axis is out of bounds.
Sourcepub fn dim(&self) -> <D as Dimension>::Pattern
pub fn dim(&self) -> <D as Dimension>::Pattern
Return the shape of the array in its “pattern” form, an integer in the one-dimensional case, tuple in the n-dimensional cases and so on.
Sourcepub fn raw_dim(&self) -> D
pub fn raw_dim(&self) -> D
Return the shape of the array as it’s stored in the array.
This is primarily useful for passing to other ArrayBase
functions, such as when creating another array of the same
shape and dimensionality.
use ndarray::Array;
let a = Array::from_elem((2, 3), 5.);
// Create an array of zeros that's the same shape and dimensionality as `a`.
let b = Array::<f64, _>::zeros(a.raw_dim());Sourcepub fn shape(&self) -> &[usize]
pub fn shape(&self) -> &[usize]
Return the shape of the array as a slice.
Note that you probably don’t want to use this to create an array of the
same shape as another array because creating an array with e.g.
Array::zeros() using a shape of type &[usize]
results in a dynamic-dimensional array. If you want to create an array
that has the same shape and dimensionality as another array, use
.raw_dim() instead:
use ndarray::{Array, Array2};
let a = Array2::<i32>::zeros((3, 4));
let shape = a.shape();
assert_eq!(shape, &[3, 4]);
// Since `a.shape()` returned `&[usize]`, we get an `ArrayD` instance:
let b = Array::zeros(shape);
assert_eq!(a.clone().into_dyn(), b);
// To get the same dimension type, use `.raw_dim()` instead:
let c = Array::zeros(a.raw_dim());
assert_eq!(a, c);Sourcepub fn stride_of(&self, axis: Axis) -> isize
pub fn stride_of(&self, axis: Axis) -> isize
Return the stride of axis.
The axis should be in the range Axis( 0 .. n ) where n is the
number of dimensions (axes) of the array.
Panics if the axis is out of bounds.
Sourcepub fn is_standard_layout(&self) -> bool
pub fn is_standard_layout(&self) -> bool
Return true if the array data is laid out in contiguous “C order” in
memory (where the last index is the most rapidly varying).
Return false otherwise, i.e. the array is possibly not
contiguous in memory, it has custom strides, etc.
Sourcepub fn max_stride_axis(&self) -> Axis
pub fn max_stride_axis(&self) -> Axis
Return the axis with the greatest stride (by absolute value), preferring axes with len > 1.
Trait Implementations§
Source§impl<A, B, S, D, F> Apply<F> for ParamsBase<S, D, A>
impl<A, B, S, D, F> Apply<F> for ParamsBase<S, D, A>
Source§impl<A, S, T> Backward<ArrayBase<S, Dim<[usize; 0]>, A>, ArrayBase<T, Dim<[usize; 0]>, A>> for ParamsBase<OwnedRepr<A>, Dim<[usize; 1]>, A>
impl<A, S, T> Backward<ArrayBase<S, Dim<[usize; 0]>, A>, ArrayBase<T, Dim<[usize; 0]>, A>> for ParamsBase<OwnedRepr<A>, Dim<[usize; 1]>, A>
Source§impl<A, S, T> Backward<ArrayBase<S, Dim<[usize; 1]>, A>, ArrayBase<T, Dim<[usize; 1]>, A>> for ParamsBase<OwnedRepr<A>, Dim<[usize; 2]>, A>
impl<A, S, T> Backward<ArrayBase<S, Dim<[usize; 1]>, A>, ArrayBase<T, Dim<[usize; 1]>, A>> for ParamsBase<OwnedRepr<A>, Dim<[usize; 2]>, A>
Source§impl<A, D1, D2, S1, S2> Backward<ArrayBase<S1, D1, A>, ArrayBase<S2, D2, A>> for ParamsBase<OwnedRepr<A>, D1, A>
impl<A, D1, D2, S1, S2> Backward<ArrayBase<S1, D1, A>, ArrayBase<S2, D2, A>> for ParamsBase<OwnedRepr<A>, D1, A>
Source§impl<A, S, D> Biased<S, D, A> for ParamsBase<S, D, A>
impl<A, S, D> Biased<S, D, A> for ParamsBase<S, D, A>
Source§fn bias_mut(&mut self) -> &mut ArrayBase<S, <D as Dimension>::Smaller, A>
fn bias_mut(&mut self) -> &mut ArrayBase<S, <D as Dimension>::Smaller, A>
Source§fn assign_bias(
&mut self,
bias: &ArrayBase<S, <D as Dimension>::Smaller, A>,
) -> &mut Self
fn assign_bias( &mut self, bias: &ArrayBase<S, <D as Dimension>::Smaller, A>, ) -> &mut Self
Source§fn replace_bias(
&mut self,
bias: ArrayBase<S, <D as Dimension>::Smaller, A>,
) -> ArrayBase<S, <D as Dimension>::Smaller, A>
fn replace_bias( &mut self, bias: ArrayBase<S, <D as Dimension>::Smaller, A>, ) -> ArrayBase<S, <D as Dimension>::Smaller, A>
Source§fn set_bias(
&mut self,
bias: ArrayBase<S, <D as Dimension>::Smaller, A>,
) -> &mut Self
fn set_bias( &mut self, bias: ArrayBase<S, <D as Dimension>::Smaller, A>, ) -> &mut Self
Source§impl<A, S, D> Clone for ParamsBase<S, D, A>
impl<A, S, D> Clone for ParamsBase<S, D, A>
Source§fn clone(&self) -> ParamsBase<S, D, A>
fn clone(&self) -> ParamsBase<S, D, A>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<A, S, D> Debug for ParamsBase<S, D, A>
impl<A, S, D> Debug for ParamsBase<S, D, A>
Source§impl<S, D> Deref for ParamsBase<S, D>
impl<S, D> Deref for ParamsBase<S, D>
Source§impl<A, S, D> Display for ParamsBase<S, D, A>
impl<A, S, D> Display for ParamsBase<S, D, A>
Source§impl<S, D, A> ExactDimParams for ParamsBase<S, D, A>
impl<S, D, A> ExactDimParams for ParamsBase<S, D, A>
Source§impl<A, S, D> FillLike<A> for ParamsBase<S, D, A>
impl<A, S, D> FillLike<A> for ParamsBase<S, D, A>
type Output = ParamsBase<S, D, A>
fn fill_like(&self, elem: A) -> <ParamsBase<S, D, A> as FillLike<A>>::Output
Source§impl<A, X, Y, Z, S, D> Forward<X> for ParamsBase<S, D, A>
impl<A, X, Y, Z, S, D> Forward<X> for ParamsBase<S, D, A>
type Output = Z
Source§fn forward(&self, input: &X) -> <ParamsBase<S, D, A> as Forward<X>>::Output
fn forward(&self, input: &X) -> <ParamsBase<S, D, A> as Forward<X>>::Output
Source§fn forward_then<F>(&self, input: &Rhs, then: F) -> Self::Output
fn forward_then<F>(&self, input: &Rhs, then: F) -> Self::Output
Source§impl<A, S, D> IntoIterator for ParamsBase<S, D, A>
impl<A, S, D> IntoIterator for ParamsBase<S, D, A>
Source§type Item = ParamsBase<S, D, A>
type Item = ParamsBase<S, D, A>
Source§type IntoIter = Once<ParamsBase<S, D, A>>
type IntoIter = Once<ParamsBase<S, D, A>>
Source§fn into_iter(self) -> <ParamsBase<S, D, A> as IntoIterator>::IntoIter
fn into_iter(self) -> <ParamsBase<S, D, A> as IntoIterator>::IntoIter
Source§impl<A, B, S, D, F> MapInto<F, B> for &ParamsBase<S, D, A>
impl<A, B, S, D, F> MapInto<F, B> for &ParamsBase<S, D, A>
Source§impl<A, B, S, D, F> MapInto<F, B> for ParamsBase<S, D, A>
impl<A, B, S, D, F> MapInto<F, B> for ParamsBase<S, D, A>
Source§impl<A, B, S, D, F> MapTo<F, B> for ParamsBase<S, D, A>
impl<A, B, S, D, F> MapTo<F, B> for ParamsBase<S, D, A>
Source§impl<A, S, D> OnesLike for ParamsBase<S, D, A>
impl<A, S, D> OnesLike for ParamsBase<S, D, A>
type Output = ParamsBase<S, D, A>
fn ones_like(&self) -> <ParamsBase<S, D, A> as OnesLike>::Output
Source§impl<A, S, D> PartialEq<&ParamsBase<S, D, A>> for ParamsBase<S, D, A>
impl<A, S, D> PartialEq<&ParamsBase<S, D, A>> for ParamsBase<S, D, A>
Source§impl<A, S, D> PartialEq<&mut ParamsBase<S, D, A>> for ParamsBase<S, D, A>
impl<A, S, D> PartialEq<&mut ParamsBase<S, D, A>> for ParamsBase<S, D, A>
Source§impl<A, S, D> PartialEq for ParamsBase<S, D, A>
impl<A, S, D> PartialEq for ParamsBase<S, D, A>
Source§impl<S, D> RawHidden<S, D> for ParamsBase<S, D>
impl<S, D> RawHidden<S, D> for ParamsBase<S, D>
Source§impl<S, D, A> RawParams for ParamsBase<S, D, A>
impl<S, D, A> RawParams for ParamsBase<S, D, A>
Source§impl<A, S, D> RawSpace for ParamsBase<S, D, A>
impl<A, S, D> RawSpace for ParamsBase<S, D, A>
Source§impl<S, D, A> TensorParams for ParamsBase<S, D, A>
impl<S, D, A> TensorParams for ParamsBase<S, D, A>
Source§impl<A, S, D> Weighted<S, D, A> for ParamsBase<S, D, A>
impl<A, S, D> Weighted<S, D, A> for ParamsBase<S, D, A>
type Tensor<_S: RawData<Elem = _A>, _D: Dimension, _A> = ArrayBase<_S, _D, _A>
Source§fn weights_mut(&mut self) -> &mut ArrayBase<S, D, A>
fn weights_mut(&mut self) -> &mut ArrayBase<S, D, A>
Source§fn replace_weights(
&mut self,
weights: Self::Tensor<S, D, A>,
) -> Self::Tensor<S, D, A>
fn replace_weights( &mut self, weights: Self::Tensor<S, D, A>, ) -> Self::Tensor<S, D, A>
Source§fn set_weights(&mut self, weights: Self::Tensor<S, D, A>) -> &mut Self
fn set_weights(&mut self, weights: Self::Tensor<S, D, A>) -> &mut Self
Source§impl<A, S, D> ZerosLike for ParamsBase<S, D, A>
impl<A, S, D> ZerosLike for ParamsBase<S, D, A>
type Output = ParamsBase<S, D, A>
fn zeros_like(&self) -> <ParamsBase<S, D, A> as ZerosLike>::Output
impl<A, S, D> Copy for ParamsBase<S, D, A>
impl<A, S, D> Eq for ParamsBase<S, D, A>
impl<S, D> ShallowModelRepr<S, D> for ParamsBase<S, D>
Auto Trait Implementations§
impl<S, D, A> Freeze for ParamsBase<S, D, A>
impl<S, D, A> RefUnwindSafe for ParamsBase<S, D, A>where
S: RefUnwindSafe,
<D as Dimension>::Smaller: RefUnwindSafe,
D: RefUnwindSafe,
A: RefUnwindSafe,
impl<S, D, A> Send for ParamsBase<S, D, A>
impl<S, D, A> Sync for ParamsBase<S, D, A>
impl<S, D, A> Unpin for ParamsBase<S, D, A>
impl<S, D, A> UnwindSafe for ParamsBase<S, D, A>
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.