Main Page   Modules   Data Structures   File List   Data Fields   Globals   Related Pages  

gnn_line_search.h File Reference

#include "gnn_evaluation.h"

Include dependency graph for gnn_line_search.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Defines

#define GNN_GOLDEN_LIMIT   100.0
 Golden Section maximum magnification for parabolic fit.

#define GNN_GOLDEN_TINY   1.0e-20
 Golden Section tiny value.

#define GNN_GOLDEN_OLD   1.61803399
 Ratio for Golden Section interval magnification.

#define GNN_GOLDEN_R   0.61803399
 Golden Ratios.

#define GNN_GOLDEN_C   (1.0 - GNN_GOLDEN_R)
 Golden Ratios.

#define GNN_BRENT_ITMAX   100
 Maximum number of iterations for Brent's line search.

#define GNN_BRENT_CGOLD   0.3819660
 Golden Ratio.

#define GNN_BRENT_ZEPS   1.0e-10
 Small number that protects against too much fractional accuracy.


Typedefs

typedef double(* gnn_line_search_type )(gnn_line *line, size_t s, size_t n, double ax, double bx, double cx, double *xmin, double tol)
 The type of line search routines.


Functions

int gnn_line_search_bracket (gnn_line *line, size_t s, size_t n, double *ax, double *bx, double *cx, double *fa, double *fb, double *fc)
 Bracketing procedure.

double gnn_line_search_golden (gnn_line *line, size_t s, size_t n, double ax, double bx, double cx, double *xmin, double tol)
 Bracketing procedure.

double gnn_line_search_brent (gnn_line *line, size_t s, size_t n, double ax, double bx, double cx, double *xmin, double tol)
 Bracketing procedure.

double gnn_line_search_charalambous (gnn_line *line, size_t s, size_t n, double ax, double bx, double cx, double *xmin, double tol)
 Simple line search procedure.

double gnn_line_search_simple (gnn_line *line, size_t s, size_t n, double ax, double bx, double cx, double *xmin, double tol)
 Simple line search procedure.


Function Documentation

int gnn_line_search_bracket gnn_line   line,
size_t    s,
size_t    n,
double *    ax,
double *    bx,
double *    cx,
double *    fa,
double *    fb,
double *    fc
 

Given a Evaluations. buffer, and given distinct initial points ax and bx, this routine searches in the downhill direction (defined by the function associated to line as evaluated at the initial points) and returns new points ax, bx, cx that bracket a minimum of the function. Also returned are the function values at the three points, fa, fb, and fc.

[Adapted from Numerical Recipes in C.]

Parameters:
line  A pointer to a Evaluations. buffer.
s  The index of the first pattern in the minibatch to be evaluated.
n  The size of the minibatch to be evaluated.
ax  A pointer to an initial point.
bx  A pointer to the second initial point.
cx  A pointer where the middle point should be placed in.
fa  A pointer where the value should be placed in.
fb  A pointer where the value should be placed in.
fc  A pointer where the value should be placed in.
Returns:
Returns 0 if succeeded.

Definition at line 90 of file gnn_line_search.c.

double gnn_line_search_brent gnn_line   line,
size_t    s,
size_t    n,
double    ax,
double    bx,
double    cx,
double *    xmin,
double    tol
 

Given a Evaluations. buffer line, and given a bracketing triplet of abscissas ax, bx, cx (such that bx is between ax and cx, and f(bx) is less than both f(ax) and f(cx)), this routine isolates the minimum to a fractional precision of about tol using Brent’s method. The abscissa of the minimum is returned as xmin, and the minimum function value is returned as brent, the returned function value.

Parameters:
line  A pointer to a Evaluations. buffer.
s  The index of the first pattern in the minibatch to be evaluated.
n  The size of the minibatch to be evaluated.
ax  Initial point of the bracketing triplet.
bx  Middle point of the bracketing triplet.
cx  Last point of the bracketing triplet.
xmin  The location of the minimum.
tol  Fractional precision tolerance.
Returns:
Returns the minimum function value.

Definition at line 323 of file gnn_line_search.c.

double gnn_line_search_charalambous gnn_line   line,
size_t    s,
size_t    n,
double    ax,
double    bx,
double    cx,
double *    xmin,
double    tol
 

Todo:
Not implemented yet.
Parameters:
line  A pointer to a Evaluations. buffer.
s  The index of the first pattern in the minibatch to be evaluated.
n  The size of the minibatch to be evaluated.
ax  Initial point of the bracketing triplet.
bx  Middle point of the bracketing triplet.
cx  Last point of the bracketing triplet.
xmin  The location of the minimum.
tol  Fractional precision tolerance.
Returns:
Returns the minimum function value.

Definition at line 463 of file gnn_line_search.c.

double gnn_line_search_golden gnn_line   line,
size_t    s,
size_t    n,
double    ax,
double    bx,
double    cx,
double *    xmin,
double    tol
 

Given a Evaluations. buffer line, and given a bracketing triplet of abscissas ax, bx, cx (such that bx is between ax and cx, and f(bx) is less than both f(ax) and f(cx)), this routine performs a golden section search for the minimum error, isolating it to a fractional precision of about tol. The abscissa of the minimum is returned as xmin, and the minimum function value is returned as golden, the returned function value.

[Adapted from Numerical Recipes in C.]

Parameters:
line  A pointer to a Evaluations. buffer.
s  The index of the first pattern in the minibatch to be evaluated.
n  The size of the minibatch to be evaluated.
ax  Initial point of the bracketing triplet.
bx  Middle point of the bracketing triplet.
cx  Last point of the bracketing triplet.
xmin  The location of the minimum.
tol  Fractional precision tolerance.
Returns:
Returns the minimum function value.

Definition at line 226 of file gnn_line_search.c.

double gnn_line_search_simple gnn_line   line,
size_t    s,
size_t    n,
double    ax,
double    bx,
double    cx,
double *    xmin,
double    tol
 

This function implements a simple but robust line search routine. It returns the , where

is minimized.

The strategy is the following:

  • Start with a fixed
  • Compute , ,
  • If , then proceed to interpolate.
  • If , then and retry.
  • If , then and retry.
The interpolation is performed by a quadratic polynom:

where the coefficients are

which gives the solution for :

Parameters:
line  A pointer to a Evaluations. buffer.
s  The index of the first pattern in the minibatch to be evaluated.
n  The size of the minibatch to be evaluated.
ax  Initial point of the bracketing triplet.
bx  Middle point of the bracketing triplet.
cx  Last point of the bracketing triplet.
xmin  The location of the minimum.
tol  Fractional precision tolerance.
Returns:
Returns the minimum function value.

Definition at line 510 of file gnn_line_search.c.


Generated on Sun Jun 13 20:50:48 2004 for libgnn Gradient Retropropagation Machine Library by doxygen1.2.18