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...

 

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

◆ SVDWrapper()

SVDWrapper ( const Factorizer &  factorizer = Factorizer())
inline

Definition at line 44 of file svd_wrapper.hpp.

Member Function Documentation

◆ Apply() [1/2]

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.

Parameters
Vinput matrix
Wfirst unitary matrix
sigmaeigenvalue matrix
Hsecond unitary matrix
Note
V = W * sigma * arma::trans(H)

◆ Apply() [2/2]

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.

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

The documentation for this class was generated from the following file:
  • /home/ryan/src/mlpack.org/_src/mlpack-git/src/mlpack/methods/cf/svd_wrapper.hpp