mlpack  master
Public Member Functions | Private Attributes | List of all members
mlpack::amf::GivenInitialization Class Reference

This initialization rule for AMF simply fills the W and H matrices with the matrices given to the constructor of this object. More...

Public Member Functions

 GivenInitialization ()
 
 GivenInitialization (const arma::mat &w, const arma::mat &h)
 
 GivenInitialization (const arma::mat &&w, const arma::mat &&h)
 
template<typename MatType >
void Initialize (const MatType &, const size_t, arma::mat &W, arma::mat &H)
 Fill W and H with random uniform noise. More...
 
template<typename Archive >
void Serialize (Archive &ar, const unsigned int)
 Serialize the object (in this case, there is nothing to serialize). More...
 

Private Attributes

arma::mat h
 The H matrix for initialization. More...
 
arma::mat w
 The W matrix for initialization. More...
 

Detailed Description

This initialization rule for AMF simply fills the W and H matrices with the matrices given to the constructor of this object.

Note that this object does not use std::move() during the Initialize() method, so it can be reused for multiple AMF objects, but will incur copies of the W and H matrices.

Definition at line 27 of file given_init.hpp.

Constructor & Destructor Documentation

mlpack::amf::GivenInitialization::GivenInitialization ( )
inline

Definition at line 31 of file given_init.hpp.

mlpack::amf::GivenInitialization::GivenInitialization ( const arma::mat &  w,
const arma::mat &  h 
)
inline

Definition at line 34 of file given_init.hpp.

mlpack::amf::GivenInitialization::GivenInitialization ( const arma::mat &&  w,
const arma::mat &&  h 
)
inline

Definition at line 38 of file given_init.hpp.

Member Function Documentation

template<typename MatType >
void mlpack::amf::GivenInitialization::Initialize ( const MatType &  ,
const size_t  ,
arma::mat &  W,
arma::mat &  H 
)
inline

Fill W and H with random uniform noise.

Parameters
VInput matrix.
rRank of decomposition.
WW matrix, to be filled with random noise.
HH matrix, to be filled with random noise.

Definition at line 52 of file given_init.hpp.

References h, and w.

template<typename Archive >
void mlpack::amf::GivenInitialization::Serialize ( Archive &  ar,
const unsigned  int 
)
inline

Serialize the object (in this case, there is nothing to serialize).

Definition at line 64 of file given_init.hpp.

References mlpack::data::CreateNVP(), h, and w.

Member Data Documentation

arma::mat mlpack::amf::GivenInitialization::h
private

The H matrix for initialization.

Definition at line 74 of file given_init.hpp.

Referenced by Initialize(), and Serialize().

arma::mat mlpack::amf::GivenInitialization::w
private

The W matrix for initialization.

Definition at line 72 of file given_init.hpp.

Referenced by Initialize(), and Serialize().


The documentation for this class was generated from the following file: