SHOGUN  4.1.0
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义  
| 宏定义 | 类型定义 | 函数 | 变量
lbfgs.cpp 文件参考

浏览源代码.

struct  tag_callback_data
 
struct  tag_iteration_data
 

宏定义

#define min2(a, b)   ((a) <= (b) ? (a) : (b))
 
#define max2(a, b)   ((a) >= (b) ? (a) : (b))
 
#define max3(a, b, c)   max2(max2((a), (b)), (c));
 
#define USES_MINIMIZER   float64_t a, d, gamma, theta, p, q, r, s;
 
#define CUBIC_MINIMIZER(cm, u, fu, du, v, fv, dv)
 
#define CUBIC_MINIMIZER2(cm, u, fu, du, v, fv, dv, xmin, xmax)
 
#define QUARD_MINIMIZER(qm, u, fu, du, v, fv)
 
#define QUARD_MINIMIZER2(qm, u, du, v, dv)
 
#define fsigndiff(x, y)   (*(x) * (*(y) / fabs(*(y))) < 0.)
 

类型定义

typedef struct tag_callback_data callback_data_t
 
typedef struct tag_iteration_data iteration_data_t
 
typedef int32_t(* line_search_proc )(int32_t n, float64_t *x, float64_t *f, float64_t *g, float64_t *s, float64_t *stp, const float64_t *xp, const float64_t *gp, float64_t *wa, callback_data_t *cd, const lbfgs_parameter_t *param)
 

函数

static int32_t line_search_backtracking (int32_t n, float64_t *x, float64_t *f, float64_t *g, float64_t *s, float64_t *stp, const float64_t *xp, const float64_t *gp, float64_t *wa, callback_data_t *cd, const lbfgs_parameter_t *param)
 
static int32_t line_search_backtracking_owlqn (int32_t n, float64_t *x, float64_t *f, float64_t *g, float64_t *s, float64_t *stp, const float64_t *xp, const float64_t *gp, float64_t *wp, callback_data_t *cd, const lbfgs_parameter_t *param)
 
static int32_t line_search_morethuente (int32_t n, float64_t *x, float64_t *f, float64_t *g, float64_t *s, float64_t *stp, const float64_t *xp, const float64_t *gp, float64_t *wa, callback_data_t *cd, const lbfgs_parameter_t *param)
 
static int32_t update_trial_interval (float64_t *x, float64_t *fx, float64_t *dx, float64_t *y, float64_t *fy, float64_t *dy, float64_t *t, float64_t *ft, float64_t *dt, const float64_t tmin, const float64_t tmax, int32_t *brackt)
 
static float64_t owlqn_x1norm (const float64_t *x, const int32_t start, const int32_t n)
 
static void owlqn_pseudo_gradient (float64_t *pg, const float64_t *x, const float64_t *g, const int32_t n, const float64_t c, const int32_t start, const int32_t end)
 
static void owlqn_project (float64_t *d, const float64_t *sign, const int32_t start, const int32_t end)
 
void lbfgs_parameter_init (lbfgs_parameter_t *param)
 
int32_t lbfgs (int32_t n, float64_t *x, float64_t *ptr_fx, lbfgs_evaluate_t proc_evaluate, lbfgs_progress_t proc_progress, void *instance, lbfgs_parameter_t *_param, lbfgs_adjust_step_t proc_adjust_step)
 

变量

static const lbfgs_parameter_t _defparam
 

宏定义说明

#define CUBIC_MINIMIZER (   cm,
  u,
  fu,
  du,
  v,
  fv,
  dv 
)
值:
d = (v) - (u); \
theta = ((fu) - (fv)) * 3 / d + (du) + (dv); \
p = fabs(theta); \
q = fabs(du); \
r = fabs(dv); \
s = max3(p, q, r); \
/* gamma = s*sqrt((theta/s)**2 - (du/s) * (dv/s)) */ \
a = theta / s; \
gamma = s * sqrt(a * a - ((du) / s) * ((dv) / s)); \
if ((v) < (u)) gamma = -gamma; \
p = gamma - (du) + theta; \
q = gamma - (du) + gamma + (dv); \
r = p / q; \
(cm) = (u) + r * d;
#define max3(a, b, c)
Definition: lbfgs.cpp:80

Find a minimizer of an interpolated cubic function.

参数
cmThe minimizer of the interpolated cubic.
uThe value of one point, u.
fuThe value of f(u).
duThe value of f'(u).
vThe value of another point, v.
fvThe value of f(v).
dvThe value of f'(v).

在文件 lbfgs.cpp1011 行定义.

#define CUBIC_MINIMIZER2 (   cm,
  u,
  fu,
  du,
  v,
  fv,
  dv,
  xmin,
  xmax 
)
值:
d = (v) - (u); \
theta = ((fu) - (fv)) * 3 / d + (du) + (dv); \
p = fabs(theta); \
q = fabs(du); \
r = fabs(dv); \
s = max3(p, q, r); \
/* gamma = s*sqrt((theta/s)**2 - (du/s) * (dv/s)) */ \
a = theta / s; \
gamma = s * sqrt(max2(0, a * a - ((du) / s) * ((dv) / s))); \
if ((u) < (v)) gamma = -gamma; \
p = gamma - (dv) + theta; \
q = gamma - (dv) + gamma + (du); \
r = p / q; \
if (r < 0. && gamma != 0.) { \
(cm) = (v) - r * d; \
} else if (a < 0) { \
(cm) = (xmax); \
} else { \
(cm) = (xmin); \
}
#define max2(a, b)
Definition: lbfgs.cpp:79
#define max3(a, b, c)
Definition: lbfgs.cpp:80

Find a minimizer of an interpolated cubic function.

参数
cmThe minimizer of the interpolated cubic.
uThe value of one point, u.
fuThe value of f(u).
duThe value of f'(u).
vThe value of another point, v.
fvThe value of f(v).
duThe value of f'(v).
xminThe minimum value.
xmaxThe maximum value.

在文件 lbfgs.cpp1039 行定义.

#define fsigndiff (   x,
 
)    (*(x) * (*(y) / fabs(*(y))) < 0.)

在文件 lbfgs.cpp1086 行定义.

#define max2 (   a,
 
)    ((a) >= (b) ? (a) : (b))

在文件 lbfgs.cpp79 行定义.

#define max3 (   a,
  b,
 
)    max2(max2((a), (b)), (c));

在文件 lbfgs.cpp80 行定义.

#define min2 (   a,
 
)    ((a) <= (b) ? (a) : (b))

在文件 lbfgs.cpp78 行定义.

#define QUARD_MINIMIZER (   qm,
  u,
  fu,
  du,
  v,
  fv 
)
值:
a = (v) - (u); \
(qm) = (u) + (du) / (((fu) - (fv)) / a + (du)) / 2 * a;

Find a minimizer of an interpolated quadratic function.

参数
qmThe minimizer of the interpolated quadratic.
uThe value of one point, u.
fuThe value of f(u).
duThe value of f'(u).
vThe value of another point, v.
fvThe value of f(v).

在文件 lbfgs.cpp1070 行定义.

#define QUARD_MINIMIZER2 (   qm,
  u,
  du,
  v,
  dv 
)
值:
a = (u) - (v); \
(qm) = (v) + (dv) / ((dv) - (du)) * a;

Find a minimizer of an interpolated quadratic function.

参数
qmThe minimizer of the interpolated quadratic.
uThe value of one point, u.
duThe value of f'(u).
vThe value of another point, v.
dvThe value of f'(v).

在文件 lbfgs.cpp1082 行定义.

#define USES_MINIMIZER   float64_t a, d, gamma, theta, p, q, r, s;

Define the local variables for computing minimizers.

在文件 lbfgs.cpp998 行定义.


SHOGUN 机器学习工具包 - 项目文档