LDA++
SecondOrderLogisticRegressionApproximation.hpp
1 #ifndef _LDAPLUSPLUS_OPTIMIZATION_SECOND_ORDER_LOGISTIC_REGRESSION_APPROXIMATION_HPP_
2 #define _LDAPLUSPLUS_OPTIMIZATION_SECOND_ORDER_LOGISTIC_REGRESSION_APPROXIMATION_HPP_
3 
4 #include <cmath>
5 
6 #include <Eigen/Core>
7 
8 namespace ldaplusplus {
9 namespace optimization {
10 
11 
33 template <typename Scalar>
35 {
36  typedef Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic> MatrixX;
37  typedef Eigen::Matrix<Scalar, Eigen::Dynamic, 1> VectorX;
38 
39  public:
53  const MatrixX &X,
54  const std::vector<MatrixX> &X_var,
55  const Eigen::VectorXi &y,
56  VectorX Cy,
57  Scalar L
58  );
59 
71  const MatrixX &X,
72  const std::vector<MatrixX> &X_var,
73  const Eigen::VectorXi &y,
74  Scalar L
75  );
76 
102  Scalar value(const MatrixX &eta) const;
103 
140  void gradient(const MatrixX &eta, Eigen::Ref<MatrixX> grad) const;
141 
142  private:
143  const MatrixX &X_;
144  const std::vector<MatrixX> &X_var_;
145  const Eigen::VectorXi &y_;
146  Scalar L_;
147  VectorX Cy_;
148 };
149 
150 
151 } // namespace optimization
152 } // namespace ldaplusplus
153 
154 #endif // _LDAPLUSPLUS_OPTIMIZATION_SECOND_ORDER_LOGISTIC_REGRESSION_APPROXIMATION_HPP_
void gradient(const MatrixX &eta, Eigen::Ref< MatrixX > grad) const
Definition: SecondOrderLogisticRegressionApproximation.cpp:73
SecondOrderLogisticRegressionApproximation(const MatrixX &X, const std::vector< MatrixX > &X_var, const Eigen::VectorXi &y, VectorX Cy, Scalar L)
Definition: SecondOrderLogisticRegressionApproximation.cpp:33
Scalar value(const MatrixX &eta) const
Definition: SecondOrderLogisticRegressionApproximation.cpp:44
Definition: SecondOrderLogisticRegressionApproximation.hpp:34
Definition: Document.hpp:11