Struct fetish_lib::normal_inverse_wishart::NormalInverseWishart [−][src]
pub struct NormalInverseWishart { pub mean: Array2<f32>, pub precision_u: Array2<f32>, pub precision: Array2<f32>, pub sigma: Array2<f32>, pub big_v: Array2<f32>, pub little_v: f32, pub t: usize, pub s: usize, }
Expand description
Matrix-normal-inverse-wishart distribution representation for bayesian inference
Fields
mean: Array2<f32>
precision_u: Array2<f32>
Expand description
This is always maintained to equal mean.dot(&precision)
precision: Array2<f32>
sigma: Array2<f32>
Expand description
This is always maintained to equal pseudoinverse_h(&precision)
big_v: Array2<f32>
little_v: f32
t: usize
Expand description
The output dimensionality
s: usize
Expand description
The input dimensionality
Implementations
impl NormalInverseWishart
[src]
impl NormalInverseWishart
[src]pub fn recompute_derived(&mut self)
[src]
pub fn recompute_derived(&mut self)
[src]Manually re-computes self.sigma
and self.precision_u
to
align with their definitions based on the other fields in self
.
This method takes cubic time, so it’s not recommended to call this
unless you observe issues with these fields accumulating numerical
errors away from what they should be.
pub fn get_total_dims(&self) -> usize
[src]
pub fn get_total_dims(&self) -> usize
[src]Gets the total dimensionality of self.mean
.
pub fn sample(&self, rng: &mut ThreadRng) -> Array2<f32>
[src]
pub fn sample(&self, rng: &mut ThreadRng) -> Array2<f32>
[src]Draws a sample from the represented MNIW distribution
pub fn sample_as_vec(&self, rng: &mut ThreadRng) -> Array1<f32>
[src]
pub fn sample_as_vec(&self, rng: &mut ThreadRng) -> Array1<f32>
[src]The same as Self::sample
, but the result is flattened.
pub fn get_mean_as_vec(&self) -> ArrayView1<'_, f32>
[src]
pub fn get_mean_as_vec(&self) -> ArrayView1<'_, f32>
[src]Returns the mean of the represented MNIW distribution, but flattened to be a vector.
pub fn get_mean(&self) -> Array2<f32>
[src]
pub fn get_mean(&self) -> Array2<f32>
[src]Returns the mean of the represented MNIW distribution as a linear map.
pub fn get_schmear(&self) -> FuncSchmear
[src]
pub fn get_schmear(&self) -> FuncSchmear
[src]Gets the FuncSchmear
over linear mappings given by this MNIW distribution
pub fn get_inverse_schmear(&self) -> FuncInverseSchmear
[src]
pub fn get_inverse_schmear(&self) -> FuncInverseSchmear
[src]Gets the FuncInverseSchmear
over linear mappings given by this MNIW distribution.
pub fn get_precision(&self) -> FuncScatterTensor
[src]
pub fn get_precision(&self) -> FuncScatterTensor
[src]Gets the precision (inverse covariance) FuncScatterTensor
of this MNIW distribution.
pub fn get_covariance(&self) -> FuncScatterTensor
[src]
pub fn get_covariance(&self) -> FuncScatterTensor
[src]Gets the covariance FuncScatterTensor
of this MNIW distribution.
impl NormalInverseWishart
[src]
impl NormalInverseWishart
[src]pub fn from_in_out_dims(
prior_specification: &dyn PriorSpecification,
feat_dims: usize,
out_dims: usize
) -> NormalInverseWishart
[src]
pub fn from_in_out_dims(
prior_specification: &dyn PriorSpecification,
feat_dims: usize,
out_dims: usize
) -> NormalInverseWishart
[src]Constructs a NormalInverseWishart
distribution from the given PriorSpecification
,
the given feature dimensions, and the given output dimensions.
pub fn from_space_info(
prior_specification: &dyn PriorSpecification,
func_space_info: &FunctionSpaceInfo<'_>
) -> NormalInverseWishart
[src]
pub fn from_space_info(
prior_specification: &dyn PriorSpecification,
func_space_info: &FunctionSpaceInfo<'_>
) -> NormalInverseWishart
[src]Constructs a NormalInverseWishart
distribution from the given PriorSpecification
and the given FunctionSpaceInfo
.
impl NormalInverseWishart
[src]
impl NormalInverseWishart
[src]pub fn update_datapoints(&mut self, data_points: &DataPoints)
[src]
pub fn update_datapoints(&mut self, data_points: &DataPoints)
[src]Updates this NormalInverseWishart
distribution to reflect
new data-points for linear regression.
Trait Implementations
impl AddAssign<&'_ DataPoint> for NormalInverseWishart
[src]
impl AddAssign<&'_ DataPoint> for NormalInverseWishart
[src]fn add_assign(&mut self, other: &DataPoint)
[src]
fn add_assign(&mut self, other: &DataPoint)
[src]Updates this NormalInverseWishart
distribution to incorporate
regression information from the given DataPoint
.
impl AddAssign<&'_ InputToSchmearedOutput> for NormalInverseWishart
[src]
impl AddAssign<&'_ InputToSchmearedOutput> for NormalInverseWishart
[src]fn add_assign(&mut self, update: &InputToSchmearedOutput)
[src]
fn add_assign(&mut self, update: &InputToSchmearedOutput)
[src]Updates this NormalInverseWishart
distribution to incorporate
regression information from the given InputToSchmearedOutput
.
impl AddAssign<&'_ Multiple<InputToSchmearedOutput>> for NormalInverseWishart
[src]
impl AddAssign<&'_ Multiple<InputToSchmearedOutput>> for NormalInverseWishart
[src]fn add_assign(&mut self, update: &Multiple<InputToSchmearedOutput>)
[src]
fn add_assign(&mut self, update: &Multiple<InputToSchmearedOutput>)
[src]Performs the +=
operation. Read more
impl AddAssign<&'_ Multiple<NormalInverseWishart>> for NormalInverseWishart
[src]
impl AddAssign<&'_ Multiple<NormalInverseWishart>> for NormalInverseWishart
[src]fn add_assign(&mut self, other: &Multiple<NormalInverseWishart>)
[src]
fn add_assign(&mut self, other: &Multiple<NormalInverseWishart>)
[src]Performs the +=
operation. Read more
impl AddAssign<&'_ NormalInverseWishart> for NormalInverseWishart
[src]
impl AddAssign<&'_ NormalInverseWishart> for NormalInverseWishart
[src]fn add_assign(&mut self, other: &NormalInverseWishart)
[src]
fn add_assign(&mut self, other: &NormalInverseWishart)
[src]Updates this NormalInverseWishart
distribution to the
MNIW-sum of it and the passed in NormalInverseWishart
distribution.
impl<'a> AddAssign<&'_ NormalInverseWishart> for Model<'a>
[src]
impl<'a> AddAssign<&'_ NormalInverseWishart> for Model<'a>
[src]fn add_assign(&mut self, other: &NormalInverseWishart)
[src]
fn add_assign(&mut self, other: &NormalInverseWishart)
[src]Updates this Model
to reflect new prior information from the
given NormalInverseWishart
, which is assumed to come from another Model
with the same input and return spaces.
impl BitXorAssign<()> for NormalInverseWishart
[src]
impl BitXorAssign<()> for NormalInverseWishart
[src]fn bitxor_assign(&mut self, _rhs: ())
[src]
fn bitxor_assign(&mut self, _rhs: ())
[src]Inverts this NormalInverseWishart
distribution in place
with respect to the addition operation given by the MNIW sum. This
always will satisfy
let mut other = self.clone(); other ^= (); other += self; self == zero_normal_inverse_wishart(self.t, self.s)
impl Clone for NormalInverseWishart
[src]
impl Clone for NormalInverseWishart
[src]fn clone(&self) -> NormalInverseWishart
[src]
fn clone(&self) -> NormalInverseWishart
[src]Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]Performs copy-assignment from source
. Read more
impl SubAssign<&'_ DataPoint> for NormalInverseWishart
[src]
impl SubAssign<&'_ DataPoint> for NormalInverseWishart
[src]fn sub_assign(&mut self, other: &DataPoint)
[src]
fn sub_assign(&mut self, other: &DataPoint)
[src]Updates this NormalInverseWishart
distribution to remove
regression information from the given DataPoint
.
impl SubAssign<&'_ InputToSchmearedOutput> for NormalInverseWishart
[src]
impl SubAssign<&'_ InputToSchmearedOutput> for NormalInverseWishart
[src]fn sub_assign(&mut self, update: &InputToSchmearedOutput)
[src]
fn sub_assign(&mut self, update: &InputToSchmearedOutput)
[src]Updates this NormalInverseWishart
distribution to remove
regression information from the given InputToSchmearedOutput
.
impl SubAssign<&'_ Multiple<InputToSchmearedOutput>> for NormalInverseWishart
[src]
impl SubAssign<&'_ Multiple<InputToSchmearedOutput>> for NormalInverseWishart
[src]fn sub_assign(&mut self, update: &Multiple<InputToSchmearedOutput>)
[src]
fn sub_assign(&mut self, update: &Multiple<InputToSchmearedOutput>)
[src]Performs the -=
operation. Read more
impl SubAssign<&'_ Multiple<NormalInverseWishart>> for NormalInverseWishart
[src]
impl SubAssign<&'_ Multiple<NormalInverseWishart>> for NormalInverseWishart
[src]fn sub_assign(&mut self, other: &Multiple<NormalInverseWishart>)
[src]
fn sub_assign(&mut self, other: &Multiple<NormalInverseWishart>)
[src]Performs the -=
operation. Read more
impl SubAssign<&'_ NormalInverseWishart> for NormalInverseWishart
[src]
impl SubAssign<&'_ NormalInverseWishart> for NormalInverseWishart
[src]fn sub_assign(&mut self, other: &NormalInverseWishart)
[src]
fn sub_assign(&mut self, other: &NormalInverseWishart)
[src]Updates this NormalInverseWishart
distribution to the
MNIW-sum of it and the additive inverse of the passed in NormalInverseWishart
distribution.
impl<'a> SubAssign<&'_ NormalInverseWishart> for Model<'a>
[src]
impl<'a> SubAssign<&'_ NormalInverseWishart> for Model<'a>
[src]fn sub_assign(&mut self, other: &NormalInverseWishart)
[src]
fn sub_assign(&mut self, other: &NormalInverseWishart)
[src]Undoes the action of the corresponding add_assign
method.
Auto Trait Implementations
impl RefUnwindSafe for NormalInverseWishart
impl Send for NormalInverseWishart
impl Sync for NormalInverseWishart
impl Unpin for NormalInverseWishart
impl UnwindSafe for NormalInverseWishart
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,