Package minfx :: Package line_search :: Module test_functions
[hide private]
[frames] | no frames]

Module test_functions

source code

Testing functions.

This file is part of the minfx optimisation library.

Functions [hide private]
 
run() source code
 
func1(alpha, beta=2.0)
Test function 1.
source code
 
dfunc1(alpha, beta=2.0)
Derivative of test function 1.
source code
 
func2(alpha, beta=0.004)
Test function 2.
source code
 
dfunc2(alpha, beta=0.004)
Derivative of test function 2.
source code
 
func3(alpha, beta=0.01, l=39.0)
Test function 3.
source code
 
dfunc3(alpha, beta=0.01, l=39.0)
Derivative of test function 3.
source code
 
func456(alpha, beta1, beta2)
Test functions 4, 5, and 6.
source code
 
dfunc456(alpha, beta1, beta2)
Test functions 4, 5, and 6.
source code
Variables [hide private]
  __package__ = 'minfx.line_search'

Imports: cos, pi, sin, sqrt, array, float64, more_thuente


Function Details [hide private]

func1(alpha, beta=2.0)

source code 

Test function 1.

From More, J. J., and Thuente, D. J. 1994, Line search algorithms with guaranteed sufficient decrease. ACM Trans. Math. Softw. 20, 286-307.

The function is:

                         alpha
   phi(alpha)  =  - ---------------
                    alpha**2 + beta

dfunc1(alpha, beta=2.0)

source code 

Derivative of test function 1.

From More, J. J., and Thuente, D. J. 1994, Line search algorithms with guaranteed sufficient decrease. ACM Trans. Math. Softw. 20, 286-307.

The gradient is:

                        2*alpha**2                 1
   phi'(alpha)  =  --------------------  -  ---------------
                   (alpha**2 + beta)**2     alpha**2 + beta

func2(alpha, beta=0.004)

source code 

Test function 2.

From More, J. J., and Thuente, D. J. 1994, Line search algorithms with guaranteed sufficient decrease. ACM Trans. Math. Softw. 20, 286-307.

The function is:

   phi(alpha)  =  (alpha + beta)**5 - 2(alpha + beta)**4

dfunc2(alpha, beta=0.004)

source code 

Derivative of test function 2.

From More, J. J., and Thuente, D. J. 1994, Line search algorithms with guaranteed sufficient decrease. ACM Trans. Math. Softw. 20, 286-307.

The gradient is:

   phi'(alpha)  =  5(alpha + beta)**4 - 8(alpha + beta)**3

func3(alpha, beta=0.01, l=39.0)

source code 

Test function 3.

From More, J. J., and Thuente, D. J. 1994, Line search algorithms with guaranteed sufficient decrease. ACM Trans. Math. Softw. 20, 286-307.

The function is:

                                2(1 - beta)       / l*pi         \ 
   phi(alpha)  =  phi0(alpha) + ----------- . sin | ---- . alpha |
                                   l*pi           \  2           /

where:

                       /  1 - alpha,                     if alpha <= 1 - beta,
                       |
                       |  alpha - 1,                     if alpha >= 1 + beta,
       phi0(alpha) =  <
                       |   1                    1
                       | ------(alpha - 1)**2 + - beta,  if alpha in [1 - beta, 1 + beta].
                       \ 2*beta                 2

dfunc3(alpha, beta=0.01, l=39.0)

source code 

Derivative of test function 3.

From More, J. J., and Thuente, D. J. 1994, Line search algorithms with guaranteed sufficient decrease. ACM Trans. Math. Softw. 20, 286-307.

The gradient is:

                                                  / l*pi         \ 
   phi(alpha)  =  phi0'(alpha) + (1 - beta) . cos | ---- . alpha |
                                                  \  2           /

where:

                        /  -1,        if alpha <= 1 - beta,
                        |
                        |  1,         if alpha >= 1 + beta,
       phi0'(alpha) =  <
                        | alpha - 1
                        | ---------,  if alpha in [1 - beta, 1 + beta].
                        \   beta

func456(alpha, beta1, beta2)

source code 

Test functions 4, 5, and 6.

From More, J. J., and Thuente, D. J. 1994, Line search algorithms with guaranteed sufficient decrease. ACM Trans. Math. Softw. 20, 286-307.

The function is:

   phi(alpha)  =  gamma(beta1) * sqrt((1 - alpha)**2 + beta2**2)
                      + gamma(beta2) * sqrt(alpha**2 + beta1**2)

where:

       gamma(beta) = sqrt(1 + beta**2) - beta

dfunc456(alpha, beta1, beta2)

source code 

Test functions 4, 5, and 6.

From More, J. J., and Thuente, D. J. 1994, Line search algorithms with guaranteed sufficient decrease. ACM Trans. Math. Softw. 20, 286-307.

The function is:

                                             (1 - alpha)
   phi'(alpha)  =  - gamma(beta1) * -------------------------------
                                    sqrt((1 - alpha)**2 + beta2**2)

                                                  a
                       + gamma(beta2) * -------------------------
                                        sqrt(alpha**2 + beta1**2)

where:

       gamma(beta) = sqrt(1 + beta**2) - beta