summaryrefslogtreecommitdiff
path: root/model
diff options
context:
space:
mode:
Diffstat (limited to 'model')
-rw-r--r--model/ranksvm.cpp6
-rw-r--r--model/ranksvm.h4
-rw-r--r--model/ranksvmtn.cpp6
3 files changed, 8 insertions, 8 deletions
diff --git a/model/ranksvm.cpp b/model/ranksvm.cpp
index 2f366d6..368e16d 100644
--- a/model/ranksvm.cpp
+++ b/model/ranksvm.cpp
@@ -15,11 +15,11 @@ int maxiter = 1; // max iteration count
double prec=1e-10; // precision
// conjugate gradient
double cg_prec=1e-10; // precision
-int cg_maxiter = 2000;
+int cg_maxiter = 100;
int ls_maxiter = 20;
// line search
-double line_prec=1e-10; // precision
-double line_turb=1e-15; // purturbation
+double ls_prec=1e-10; // precision
+double ls_turb=1e-15; // purturbation
int RSVM::saveModel(const string fname){
diff --git a/model/ranksvm.h b/model/ranksvm.h
index 41de0f4..a17e3c9 100644
--- a/model/ranksvm.h
+++ b/model/ranksvm.h
@@ -46,7 +46,7 @@ extern double cg_prec; // precision
extern int cg_maxiter; // not worth having a large number
extern int ls_maxiter;
// line search
-extern double line_prec; // precision
-extern double line_turb; // purturbation
+extern double ls_prec; // precision
+extern double ls_turb; // perturbation
#endif \ No newline at end of file
diff --git a/model/ranksvmtn.cpp b/model/ranksvmtn.cpp
index 9beed65..01fcb83 100644
--- a/model/ranksvmtn.cpp
+++ b/model/ranksvmtn.cpp
@@ -192,12 +192,12 @@ int line_search(const VectorXd &w,RidList &D,const VectorXd &corr,const VectorXd
g = grad.dot(step);
cal_Hs(D,rank,corr,alpha,step,Hs);
h = Hs.dot(step);
- g=g+line_turb;
- h = h+line_turb;
+ g=g+ls_turb;
+ h = h+ls_turb;
t=t-g/h;
++iter;
LOG(INFO) << "line search iter "<<iter<<", prec:"<<g*g/h;
- if (g*g/h<line_prec)
+ if (g*g/h<ls_prec)
break;
if (iter >= ls_maxiter)
{