mlpack
3.1.1
src
mlpack
methods
cf
svd_wrapper.hpp
Go to the documentation of this file.
1
12
#ifndef MLPACK_METHODS_SVDWRAPPER_HPP
13
#define MLPACK_METHODS_SVDWRAPPER_HPP
14
15
#include <
mlpack/prereqs.hpp
>
16
17
namespace
mlpack
18
{
19
namespace
cf
20
{
21
27
class
DummyClass
{};
28
39
template
<
class
Factorizer = DummyClass>
40
class
SVDWrapper
41
{
42
public
:
43
// empty constructor
44
SVDWrapper
(
const
Factorizer& factorizer = Factorizer()) :
45
factorizer(factorizer)
46
{
47
// Nothing to do here.
48
}
49
61
double
Apply
(
const
arma::mat& V,
62
arma::mat& W,
63
arma::mat& sigma,
64
arma::mat& H)
const
;
75
double
Apply
(
const
arma::mat& V,
76
size_t
r,
77
arma::mat& W,
78
arma::mat& H)
const
;
79
80
private
:
82
Factorizer factorizer;
83
};
// class SVDWrapper
84
86
typedef
SVDWrapper<DummyClass>
ArmaSVDFactorizer
;
87
89
#include "svd_wrapper_impl.hpp"
90
91
}
// namespace cf
92
}
// namespace mlpack
93
94
#endif
mlpack::cf::SVDWrapper
This class acts as the wrapper for all SVD factorizers which are incompatible with CF module.
Definition:
svd_wrapper.hpp:40
prereqs.hpp
mlpack::cf::DummyClass
This class acts as a dummy class for passing as template parameter.
Definition:
svd_wrapper.hpp:27
mlpack
@serialization.hpp
Definition:
add_to_po.hpp:21
mlpack::cf::SVDWrapper::Apply
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.
mlpack::cf::SVDWrapper::SVDWrapper
SVDWrapper(const Factorizer &factorizer=Factorizer())
Definition:
svd_wrapper.hpp:44
mlpack::cf::ArmaSVDFactorizer
SVDWrapper< DummyClass > ArmaSVDFactorizer
add simple typedefs
Definition:
svd_wrapper.hpp:86
Generated by
1.8.17