-
Notifications
You must be signed in to change notification settings - Fork 4
/
grad_desc_sparse.hpp
30 lines (28 loc) · 1.62 KB
/
grad_desc_sparse.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#ifndef GRADDESCSPARSE_H
#define GRADDESCSPARSE_H
#include "blackbox.hpp"
namespace grad_desc_sparse {
const int SVRG_LAST_LAST = 1;
const int SVRG_AVER_AVER = 2;
const int SVRG_AVER_LAST = 3;
double* GD(double* X, double* Y, size_t* Jc, size_t* Ir, size_t N, blackbox* model
, size_t iteration_no = 10000, double L = 1.0, double step_size = 1.0
, bool is_store_result = false);
double* SGD(double* X, double* Y, size_t* Jc, size_t* Ir, size_t N, blackbox* model
, size_t iteration_no = 10000, double L = 1.0, double step_size = 1.0
, bool is_store_result = false);
std::vector<double>* SAGA(double* X, double* Y, size_t* Jc, size_t* Ir, size_t N
, blackbox* model, size_t iteration_no, double L = 1.0, double step_size = 1.0
, bool is_store_result = false);
// For Prox_SVRG / SVRG, Mode 1: last_iter--last_iter, Mode 2: aver_iter--aver_iter, Mode 3: aver_iter--last_iter
std::vector<double>* Prox_SVRG(double* X, double* Y, size_t* Jc, size_t* Ir, size_t N
, blackbox* model, size_t iteration_no, int Mode = 1, double L = 1.0, double step_size = 1.0
, bool is_store_result = false);
std::vector<double>* Katyusha(double* X, double* Y, size_t* Jc, size_t* Ir, size_t N
, blackbox* model, size_t iteration_no, double L = 1.0, double sigma = 0.0001
, double step_size = 1.0, bool is_store_result = false);
std::vector<double>* SVRG(double* X, double* Y, size_t* Jc, size_t* Ir, size_t N
, blackbox* model, size_t iteration_no, int Mode = 1, double L = 1.0, double step_size = 1.0
, bool is_store_result = false);
}
#endif