Home Contact Us Site Map  
 
       
    next up previous contents
Next: 9. Under development Up: 8.5 The line search Previous: 8.5.2 The online vs.   Contents

Subsections

8.5.3 Number of iterations vs. number of simulations

- itmax: controls the max. number of iterations
- nfunc: controls the max. number of simulations within one iteration

8.5.3.0.1 Summary

 
From one iteration to the next the descent direction changes. Within one iteration more than one forward and adjoint run may be performed. The updated control used as input for these simulations uses the same descent direction, but different step sizes.

8.5.3.0.2 Description

 
From one iteration to the next the descent direction dd changes using the result for the adjoint vector gg of the previous iteration. In lsline the updated control

$\displaystyle \tt
xdiff(i,1) = xx(i-1) + tact(i-1,1)*dd(i-1)
$

serves as input for a forward and adjoint model run yielding a new gg(i,1). In general, the new solution passes the 1st and 2nd Wolfe tests so xdiff(i,1) represents the solution sought:

$\displaystyle {\tt xx(i) = xdiff(i,1)}
$

If one of the two tests fails, an inter- or extrapolation is invoked to determine a new step size tact(i-1,2). If more than one function call is permitted, the new step size is used together with the "old" descent direction dd(i-1) (i.e. dd is not updated using the new gg(i)), to compute a new

$\displaystyle {\tt xdiff(i,2) = xx(i-1) + tact(i-1,2)*dd(i-1)}
$

that serves as input in a new forward and adjoint run, yielding gg(i,2). If now, both Wolfe tests are successful, the updated solution is given by

$\displaystyle \tt
xx(i) = xdiff(i,2) = xx(i-1) + tact(i-1,2)*dd(i-1)
$

In order to save memory both the fields dd and xdiff have a double usage.

xdiff
 
- in lsopt_top: used as x(i) - x(i-1) for Hessian update
- in lsline: intermediate result for control update x = x + tact*dd
dd
 
- in lsopt_top, lsline: descent vector, dd = -gg and hessupd
- in dgscale: intermediate result to compute new preconditioner

8.5.3.0.3 The parameter file lsopt.par

  • NUPDATE max. no. of update pairs (gg(i)-gg(i-1), xx(i)-xx(i-1)) to be stored in OPWARMD to estimate Hessian [pair of current iter. is stored in (2*jmax+2, 2*jmax+3) jmax must be > 0 to access these entries] Presently NUPDATE must be > 0 (i.e. iteration without reference to previous iterations through OPWARMD has not been tested)
  • EPSX relative precision on xx bellow which xx should not be improved
  • EPSG relative precision on gg below which optimization is considered successful
  • IPRINT controls verbose (>=1) or non-verbose output
  • NUMITER max. number of iterations of optimisation; NUMTER = 0: cold start only, no optimization
  • ITER_NUM index of new restart file to be created (not necessarily = NUMITER!)
  • NFUNC max. no. of simulations per iteration (must be > 0); is used if step size tact is inter-/extrapolated; in this case, if NFUNC > 1, a new simulation is performed with same gradient but "improved" step size
  • FMIN first guess cost function value (only used as long as first iteration not completed, i.e. for jmax <= 0)

8.5.3.0.4 OPWARMI, OPWARMD files

Two files retain values of previous iterations which are used in latest iteration to update Hessian:
  • OPWARMI: contains index settings and scalar variables

    n = nn no. of control variables
    fc = ff cost value of last iteration
    isize no. of bytes per record in OPWARMD
    m = nupdate max. no. of updates for Hessian
    jmin, jmax pointer indices for OPWARMD file (cf. below)
    gnorm0 norm of first (cold start) gradient gg
    iabsiter total number of iterations with respect to cold start

  • OPWARMD: contains vectors (control and gradient)

    entry name description
    1 xx(i) control vector of latest iteration
    2 gg(i) gradient of latest iteration
    3 xdiff(i),diag preconditioning vector; (1,...,1) for cold start
    2*jmax+2 gold=g(i)-g(i-1) for last update (jmax)
    2*jmax+3 xdiff=tact*d=xx(i)-xx(i-1) for last update (jmax)

Figure 8.1: Examples of OPWARM file handling
\begin{figure}{\footnotesize
\begin{verbatim}Example 1: jmin = 1, jmax = 3, mu...
... ___\vert \vert ___\vert ___\vert
\vert 6 7 3 4 5\end{verbatim}
}\end{figure}

8.5.3.0.5 Error handling

Figure 8.2: Flow chart (part 1 of 3)
\begin{figure}{\scriptsize
\begin{verbatim}lsopt_top
\vert
\vert---- check ...
... CALL OPTLINE / LSLINE
\vert ) \vert
... ... ...\end{verbatim}
}\end{figure}

Figure 8.3: Flow chart (part 2 of 3)
\begin{figure}{\scriptsize
\begin{verbatim}... ...
\vert )
\vert (---- CALL...
...l = 7,8,9 <<<
\vert ( goto 1000
\vert )
... ...\end{verbatim}
}\end{figure}

Figure 8.4: Flow chart (part 3 of 3)
\begin{figure}{\scriptsize
\begin{verbatim}... ...
\vert )
\vert (---- sto...
...\vert
\vert---- print final information
\vert
O\end{verbatim}
}\end{figure}


next up previous contents
Next: 9. Under development Up: 8.5 The line search Previous: 8.5.2 The online vs.   Contents
mitgcm-support@mitgcm.org
Copyright 2006 Massachusetts Institute of Technology Last update 2018-01-23