mlpack  master
Public Member Functions | Private Attributes | List of all members
mlpack::cf::SVDWrapper< Factorizer > Class Template Reference

This class acts as the wrapper for all SVD factorizers which are incompatible with CF module. More...

Public Member Functions

 SVDWrapper (const Factorizer &factorizer=Factorizer())
 
double Apply (const arma::mat &V, arma::mat &W, arma::mat &sigma, arma::mat &H) const
 Factorizer function which takes SVD of the given matrix and returns the frobenius norm of error. More...
 
double Apply (const arma::mat &V, size_t r, arma::mat &W, arma::mat &H) const
 Factorizer function which computes SVD and returns matrices as required by CF module. More...
 

Private Attributes

Factorizer factorizer
 svd factorizer More...
 

Detailed Description

template<class Factorizer = DummyClass>
class mlpack::cf::SVDWrapper< Factorizer >

This class acts as the wrapper for all SVD factorizers which are incompatible with CF module.

Normally SVD factrorizers implement Apply method which takes matrix V and factorizes it into P, sigma and Q where V = P * sigma * trans(Q). But CF module requires factrorization to be V = W * H. This class multiplies P and sigma and takes the first 'r' eigenvectors out where 'r' is the rank of factorization. Q matrix is transposed and trimmed to support the rank of factorization. The Factroizer class should implement Apply which takes matrices P, sigma, Q and V as their parameter respectively.

Definition at line 40 of file svd_wrapper.hpp.

Constructor & Destructor Documentation

template<class Factorizer = DummyClass>
mlpack::cf::SVDWrapper< Factorizer >::SVDWrapper ( const Factorizer &  factorizer = Factorizer())
inline

Definition at line 44 of file svd_wrapper.hpp.

Member Function Documentation

template<class Factorizer = DummyClass>
double mlpack::cf::SVDWrapper< Factorizer >::Apply ( const arma::mat &  V,
arma::mat &  W,
arma::mat &  sigma,
arma::mat &  H 
) const

Factorizer function which takes SVD of the given matrix and returns the frobenius norm of error.

Parameters
Vinput matrix
Wfirst unitary matrix
sigmaeigenvalue matrix
Hsecond unitary matrix
Note
V = W * sigma * arma::trans(H)
template<class Factorizer = DummyClass>
double mlpack::cf::SVDWrapper< Factorizer >::Apply ( const arma::mat &  V,
size_t  r,
arma::mat &  W,
arma::mat &  H 
) const

Factorizer function which computes SVD and returns matrices as required by CF module.

Parameters
Vinput matrix
Wfirst unitary matrix
Hsecond unitary matrix
Note
V = W * H

Member Data Documentation

template<class Factorizer = DummyClass>
Factorizer mlpack::cf::SVDWrapper< Factorizer >::factorizer
private

svd factorizer

Definition at line 79 of file svd_wrapper.hpp.


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