mlpack  2.2.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Public Attributes | List of all members
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

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

Public Attributes

 __pad0__: factorizer(factorizer) {}
 

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.

Member Function Documentation

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)
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
Wfirst unitary matrix
Hsecond unitary matrix
Note
V = W * H

Member Data Documentation

__pad0__

Definition at line 45 of file svd_wrapper.hpp.


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