Skip to content

Running CLAIRE

Overview

CLAIRE is a software for 3D diffeomorphic image registration. CLAIRE has two main binaries: claire and claire-tools.

  • claire: perform registrations
  • claire-tools: post and pre-processing

We provide several examples for executing these binaries in the doc/examples subfolder. We briefly explain these examples below.

In addition to that we have added two binaries named claire-test and claire-benchmark for developers to test the code. They are described in greater detail in the Testing and Benchmarks section below.

These binaries can be found in the bin folder after CLAIRE has been built successfully. To learn more about building claire take a look at our installation guide found in doc/README-INSTALL.md.

The binaries were renamed in 11/2026: clairetools, test and benchmark became claire-tools, claire-test and claire-benchmark. All programs use GNU-style options (e.g., --grid-size 64; claire-tools, claire-test and claire-benchmark take a command, e.g., claire-tools transport-image). The old option names still work and print a warning; doc/README-OPTIONS.md lists the old and new names and the few options whose meaning changed. Exit codes: 0 success, 1 failure while running, 2 invalid command line, 3 the solver did not converge (claire).

If you are trying to execute CLAIRE on a dedicated HPC system (multi-GPU / multi-CPU envoriment) take a look at the examples provided in the Job Submission on Dedicated Systems section.

Get Help

To learn more about the options available in claire and claire-tools use --help (common options) or --help-all (all options); claire-tools <command> --help shows the options of one command:

$BINDIR/claire --help
$BINDIR/claire-tools --help
$BINDIR/claire-tools transport-image --help

$BINDIR is the directory in which the binary is located.

Input Data

CLAIRE is a software for 3D diffeomorphic image registration. Supported input formats for CLAIRE are images stored as '.nii', '.nii.gz' or '.hdr' and '.img(.gz)'. This is the default data format for inputs and outputs generated by CLAIRE.

Simple Examples: claire

Example 01: Synthetic Problem

In runclaire01.sh we execute CLAIRE for a synthetic test problem of size 32x32x32. We use default settings for our solver:

$BINDIR/claire --synthetic 0

$BINDIR is the directory in which the binary is located. The option --synthetic allows one to select several smooth test problems. To change the problem size simply add the --grid-size <n1xn2xn3> option, where <n$i$> represents the problem size in each spatial direction (i.e., --grid-size 128x128x128 executes CLAIRE with a problem size of 128x128x128.) We recommend executing CLAIRE in parallel for larger problem sizes (see example 2)

Example 02: Synthetic Problem (Parallel Execution)

In runclaire02.sh we execute CLAIRE for a synthetic test problem of size 128x128x128 in parallel. As an example, we use 20 MPI tasks. We use default settings for our solver:

mpirun -n 20 $BINDIR/claire --synthetic 0 --grid-size 128

The options used with claire are explained in example 1. The key difference is the instruction mpirun -np 20 infront of the executable. This instructs your compute node to use 20 MPI tasks. CLAIRE will determine the processor layout for you. We recommend executing CLAIRE in parallel. If you use mpiexec replace mpirun -np 20 with mpiexec -n 20.

Example 03: Real Data

In runclaire03.sh we execute CLAIRE for real medical images (in NIfTI format) of size 128x150x128. We use 20 MPI tasks. The data can be found in the docs/data subdirectory. We use default settings for our solver:

$BINDIR/claire --reference $datdir/brain01.nii.gz \
               --template $datdir/brain02.nii.gz

Important: The images have to be affinely preregistered (i.e., have the same grid size).

$datdir points to the location where the data is located. The --reference option (short: -r) identifies the image to be used as a reference image (alas, fixed or target image) and the --template option (short: -t) identifies the image to be used as a template image (i.e., the image to be registered; alas floating or moving image). The line break (backslash \) is only added for readability.

Example 04: Regularization Parameter Estimation

In runclaire04.sh we execute CLAIRE to automatically identify an adequate regularization parameter for a given set of images. We use default settings for our solver:

$BINDIR/claire --reference $datdir/brain01.nii.gz \
               --template $datdir/brain02.nii.gz --beta-search binary

Running claire on real image data is explained in example 3. We use a method based on parameter continuation to identify an adequate regularization parameter. The search uses the determinant of the deformation gradient as a "metric". The user can define a lower bound for the Jacobian via the --jacobian-bound <dbl> option (the upper bound is 1/<dbl>). To perform the search specify the --beta-search <type> option. There are two strategies implemented: A simple reduction of the regularization parameter until the bound is hit (use --beta-search reduce) and a binary search (use --beta-search binary). The line break (backslash \) is only added for readability.

Notice that if you compile CLAIRE in single precision only H1-type regularization operators function properly (there are numerical accuracy issues for H2- and H3-type regularization operators in single precision). To use higher order regularization operators, CLAIRE needs to be compiled in double precision (slower).

Example 05: Parameter Continuation

In runclaire05.sh we show how to execute CLAIRE using a parameter continuation scheme with a target regularization parameter for the velocity. We use default settings for our solver:

$BINDIR/claire --reference $datdir/brain01.nii.gz \
               --template $datdir/brain02.nii.gz \
               --beta-target 7.75e-04

We have observed that a parameter continuation scheme speeds up the rate of convergence of our solver. We recommend using it in practical settings. We show how to estimate an adequate regularization parameter in example 4. The line breaks (backslashes \) are only added for readability.

Example 06: Output Velocities

In runclaire06.sh we show how to store the computed velocity field on file. We use default settings for our solver:

$BINDIR/claire --reference $datdir/brain01.nii.gz \
               --template $datdir/brain02.nii.gz \
               --beta-target 7.75e-04 -o ./ --save velocity

This example is a direct extension of example 4. The only difference is that we added an output. We need to provide an output folder. This is done with the -o <folder> (--output) option. We write the output to the current directory (./). The outputs in CLAIRE will have default names. If you prefer to store all files for multiple runs in a single folder, we recommend to use a prefix:

-o /my/output/folder/name/PREFIX_

The --save velocity option tells CLAIRE to write out the velocity field (--save takes a list, e.g., --save velocity,deformed-template,jacobian; see claire --help). There are multiple other outputs available, most of which can be computed from the velocity field. This can be done using claire-tools. To learn more about how to use claire-tools continue reading. The line breaks (backslashes \) are only added for readability.

Simple Examples: claire-tools

Example 01: Transporting Images

In runtools01.sh we show how to transport an image (i.e., e.g., compute the deformed template image after a velocity has been computed using claire.)

$BINDIR/claire-tools transport-image \
                     --velocity-x1 velocity-field-x1.nii.gz \
                     --velocity-x2 velocity-field-x2.nii.gz \
                     --velocity-x3 velocity-field-x3.nii.gz \
                     --input $datdir/brain01.nii.gz \
                     --output-file brain01-transported.nii.gz

The input are the three components of the computed velocity (--velocity-x$i$ velocity-field-x$i$.nii.gz) and the image to be transported (--input $datdir/brain01.nii.gz; $datdir points to the folder the data is located in, i.e., doc/data). The output is the transported brain image (--output-file brain01-transported.nii.gz). The user can add a path as prefix if desired. The command to tell claire-tools that we are interested in solving the forward problem (i.e., transporting/deforming an image) is the command transport-image. The line breaks (backslashes \) are only added for readability.

Example 02: Computing Jacobians

In runtools02.sh we show how to compute the determinant of the deformation gradient (alas Jacobian) from a velocity field that has been computed using claire.

$BINDIR/claire-tools deformation-fields \
                     --velocity-x1 velocity-field-x1.nii.gz \
                     --velocity-x2 velocity-field-x2.nii.gz \
                     --velocity-x3 velocity-field-x3.nii.gz \
                     -o ./ --save jacobian

Example 03: Converting Data

In runtools03.sh we show how to convert data from *.nii.gz to *.nc.

$BINDIR/claire-tools convert --input $datdir/brain01.nii.gz --format netcdf

The output file will be located in the same folder as the input file, with the same filename (for example, $datdir/brain01.nii.gz becomes $datdir/brain01.nc). Notice that you need to compile CLAIRE with nifti and pnetcdf enabled.

Job Submission on Dedicated Systems

TACC's Longhorn System

More information about TACC's Longhorn system can be found at https://www.tacc.utexas.edu/systems/longhorn.

To execute CLAIRE on a single GPU node, interactively, do the following:

idev -N1
ibrun $BINDIR/claire --synthetic 0 --grid-size 128

An example for a script for executing CLAIRE on Longhorn can be found here:

Tufts University HPC Cluster

More information about the Tufts HPC cluster can be found at https://rtguides.it.tufts.edu/hpc/. How to build CLAIRE there is described in doc/README-INSTALL.md.

To execute CLAIRE on a single GPU, interactively, do the following:

srun -p preempt --qos=preempt -n 8 --mem=32g --gres=gpu:a100:1 -t 2:00:00 --pty bash
module load gcc/12.4.0 openmpi/4.1.8-cuda
source deps/env_source.sh
srun --overlap -n 1 --mpi=pmix $BINDIR/claire --synthetic 0 --grid-size 128

Inside an interactive session, start MPI binaries as job steps (srun --overlap ... --mpi=pmix); starting them directly from the shell fails at MPI startup.

Testing and Benchmarks

We have implemented numerical tests for the main computational kernels available in CLAIRE to study the performance and accuracy of the mathematical operators that appear in the optimality system. For reproducability, we also posted the NIREP data at https://github.com/andreasmang/nirep. We have used this data extensively in our prior work.

To build binaries for testing add BUILD_TEST=yes to the make command (or set it in the makefile):

make -j 8 GPU_VERSION=80 BUILD_TEST=yes
This will build two additional binaries: claire-test and claire-benchmark. Both take the test or benchmark to run as a command, followed by options (e.g., claire-test regularization --grid-size 64). To inspect the commands and options use --help (common options) or --help-all (all options):
$BINDIR/claire-test --help
$BINDIR/claire-benchmark --help

$BINDIR is the directory in which the binary is located.

The claire-test application allows users to check the main computational kernels. Each run executes one group of tests, selected by the command (the short names in parentheses also work):

  • the interpolation kernels (to check the interpolation accuracy)

    $BINDIR/claire-test interpolation [options]   # (interp)
    

  • the forward solver (transport forward with \(v\) and back with \(-v\); compares the result with the initial image)

    $BINDIR/claire-test forward [options]
    

  • accuracy of trajectory computation (semi-lagrangian time integration scheme): compares the departure points with the exact ones (one rank only), and the velocity interpolated at the departure points with the velocity at the exact departure points (any number of ranks)

    $BINDIR/claire-test trajectory [options]
    

  • correctness of gradient and hessian (derivative checks; see below)

    $BINDIR/claire-test gradient [options]
    $BINDIR/claire-test hessian [options]
    

  • the regularization operators: for all norms (L2, H1, H2, H3, and the seminorms H1SN, H2SN, H3SN, independent of --regularization), the functional, the gradient, the inverse of the operator (used by the preconditioner), and the square root of the inverse (used by the symmetric and two-level preconditioners), against analytic values

    $BINDIR/claire-test regularization [options]   # (reg)
    

  • numerical differentiation (to check the accuracy of the differentiation operators)

    $BINDIR/claire-test differentiation [options]   # (diff)
    

  • spectral differentiation over a range of wave numbers

    $BINDIR/claire-test spectral [options]   # (spec)
    

  • the determinant of the deformation gradient, for a divergence-free velocity (det = 1) and for \(v = (a \sin x_1, 0, 0)\), whose flow has an analytic Jacobian (default and --jacobian-of-inverse form; the Jacobian of the inverse map must also have mean 1, i.e., conserve volume)

    $BINDIR/claire-test jacobian [options]
    

  • an end-to-end registration of synthetic problem 0 (relative gradient tolerance 1e-2): checks that the solver converges, the relative mismatch (at most 0.1; measured 0.074), and the numbers of Gauss-Newton iterations (at most 6; measured 3) and Hessian matvecs (at most 15; measured 6); catches regressions in the line search, the Krylov solver, the preconditioner and the solver logic

    $BINDIR/claire-test registration [options]
    
    These tests are implemented in the *.cpp files available in the UnitTests subfolder.

Pass/fail. Each test compares the errors it computes with a tolerance and prints one line per check, followed by a summary:

  [PASS] forward solver: relative error (forward + backward)      7.832617e-04  (tolerance 5.0e-03)
unit test summary: 1 checks, 0 failed
The exit code of claire-test is 0 if all checks passed, 1 if a check failed, and 2 if the command line is not valid (e.g., an unknown option, or no test or an unknown test given).

To build and run all groups, use the test target of the makefile. It runs the unit test of the option table (make test-options), prints one line per unit test group, writes the output of each group to bin/test-logs/<group>.log, then runs the command line tests (make test-cli, below), and fails if any test fails:

make -j 8 GPU_VERSION=80 BUILD_TEST=yes test
option table test: 99 checks, 0 failed
  interpolation   exit 0  4 checks, 0 failed
  ...
all unit test groups passed
running command line tests
command line test summary: 105 checks, 0 failed (logs in ./bin/test-cli/logs)
Command line tests. make test-cli (scripts/test-cli.sh) runs claire, claire-tools, claire-test and claire-benchmark on a small synthetic problem (about 30 s) and checks the exit codes and the error messages of invalid command lines, that the old and the new option names give the same settings and identical output files, that --print-config and --config repeat a run, the precedence of --config and the old -config, and the claire-tools commands: the files they write (also into an output folder, -o), that a transported image is not zero, the Dice score of a transported label map, that Ravens maps and transported probability maps keep the volume of each label, and the errors for a file that cannot be written and for --format netcdf without PnetCDF. It also runs registrations of the synthetic problem (32^3, about 1 s each) with each regularization norm, NCC, each preconditioner, scale continuation, --beta-target and --beta-search (with the default bound, and with a bound that is reached; the result must be within the bound, and its line searches must backtrack from the iterate), which must converge and reduce the relative mismatch below a bound, and checks that the options not available on the GPU are rejected with a usage error, and that claire starts in another folder. The label map checks make their label maps with python3 (without NumPy) and are skipped without it. Only failed checks are printed; the outputs and logs are in bin/test-cli.

Python bindings. With BUILD_PYTHON=yes, make test-python (scripts/test-pyclaire.py; also part of make test) registers two images with pyclaire on one rank and checks that invalid options and arrays of the wrong size raise ValueError; it runs in bin/ and without LD_LIBRARY_PATH, so pyclaire must find lib/libclaire.so by its run path:

make -j 8 GPU_VERSION=80 BUILD_PYTHON=yes test-python TEST_LAUNCH="srun --overlap -n 1 --mpi=pmix"

Without a GPU. make test-options CXX=c++ needs only a C++ compiler; it also runs on GitHub for every push and pull request (.github/workflows/option-table.yml, with GCC and Clang). On Slurm, give the command that starts each run with TEST_LAUNCH (see doc/README-INSTALL.md):

make -j 8 GPU_VERSION=80 BUILD_TEST=yes test TEST_LAUNCH="srun --overlap -n 1 --mpi=pmix"
More than one rank. With -n 2 or more in TEST_LAUNCH, the tests run the multi-rank code paths (slab decomposition along \(x_1\), ghost layers, scattering of the query points to the ranks that own them); the ranks can share one GPU. TEST_ARGS is passed to every run, e.g., a larger grid:
make BUILD_TEST=yes test TEST_LAUNCH="srun --overlap -n 2 --mpi=pmix"
make BUILD_TEST=yes test TEST_LAUNCH="srun --overlap -n 4 --mpi=pmix" TEST_ARGS="--grid-size 64"
All groups pass on 1, 2 and 4 ranks. Results on one rank and on more ranks are not identical: on one rank, the cubic interpolation uses B-splines (with a prefilter over the whole grid); on more ranks, it uses Lagrange polynomials, which only need the ghost layers (gpuInterp3Dkernel in src/Interpolation/interp3_gpu_new.cu). Lagrange interpolation is less accurate, e.g., the forward solver error is 7.8e-4 on one rank and 1.7e-3 on two. Forcing Lagrange interpolation on one rank reproduces the two-rank results to six digits, and 2 and 4 ranks agree to seven digits, so the decomposition itself does not change the results.

Repeated registrations are not always bit-identical. For a 32^3 registration (--synthetic 0 --newton-rtol 1e-2), three runs on one rank gave identical files on an otherwise idle node, but two runs differed by up to 3e-4 in the velocity (whose largest value is 0.16) while another build ran on the node; on two ranks, all runs differed, by up to 6e-4. The command line tests therefore compare the settings that the old and the new option names give (--print-config), and compare the output files only if a repeated registration gives identical files.

The tolerances are set for the default settings (grid size 32x32x32, 4 time steps, cubic interpolation) in single precision; finer grids also pass, coarser grids may not. Errors limited by round-off (spectral operators, regularization) are checked against a multiple of the machine precision; errors limited by the discretization (finite differences, interpolation, transport) against fixed values. The interpolation checks are skipped for --interp-order other than 3. The interpolation and trajectory errors halve when the grid spacing halves (e.g., velocity at the departure points: 1.2e-3, 6.4e-4, 3.7e-4 on 32^3, 64^3, 128^3), instead of decreasing with the fourth power of the grid spacing as expected for cubic interpolation; this is consistent with the 1/256-cell resolution of the GPU texture interpolation weights (see the gradient check below).

Notes from the regularization and jacobian tests.

  • Default form of det(grad(y)): the solver integrates \(\partial_t J + v \cdot \nabla J = J \nabla \cdot v\), so the default output is the Jacobian of the flow evaluated at the departure point of \(x\) (the volume change of the material now at \(x\)); --jacobian-of-inverse gives its reciprocal, the Jacobian of the inverse map, whose mean over the domain is 1.
  • The full norms H2 and H3 invert \(\beta_0(-\Delta + \beta_1)^N\), whose smallest eigenvalue (the constant mode) is \(\beta_0\beta_1^N\): with the default \(\beta_1 = 10^{-4}\), the inverse amplifies the round-off in the mean of its input by \(10^8\) (H2) and \(10^{12}\) (H3) relative to the other modes. In single precision this costs H3 about two digits (the test checks H3 with \(\beta_1 = 10^{-2}\)). The seminorms map the constant mode to \(1/\beta_0\) and are not affected.
  • The H3 functional is not implemented on the GPU (DifferentiationKernel::TrilaplacianFunctional), so claire rejects the H3 norm (--regularization h3-norm) in the GPU build (exit code 2), as well as the incompressible model (h1-seminorm-stokes, whose projection runs on the CPU) and grid continuation (--grid-continuation, not implemented for the GPU). The H3-seminorm does not converge in single precision (exit code 3).
  • The default model (h1-seminorm-div, the H1-seminorm with a penalty on div(v)) computes its gradient and its Hessian premultiplied by the same operator \(Q\) (the projection in CLAIREDivReg::ApplyProjection): \(Q\) is the identity for divergence-free fields, and it scales the gradient part (the component along the wave vector \(k\)) by \(\beta_v/(\beta_v + \beta_w(1 + |k|^2))\), with \(\beta_w\) the weight of the penalty (--beta-div). The term of the penalty then cancels in the Hessian, \(H = \beta_v A + Q H_D\) (with \(H_D\) the Hessian of the distance), so \(w^\top H w\) is not the curvature of the objective: on the test problem, 4.5e-3 against 8.7e-3, close to the curvature without the penalty (4.5e-3). The Newton step is that of the objective, since \(Q\) cancels in \(QH\,\tilde{v} = -Qg\). The hessian test therefore compares the Hessian of this model only with a central difference of the gradient.
  • --beta-search with a bound that the initial beta (1) already violates first increases beta, in binary and in reduce. With --synthetic 0 --grid-size 32 --jacobian-bound 0.995 (min det(grad(y)) = 0.985 for beta = 1), binary returns beta = 3.25 and reduce beta = 10, on one and on two ranks. The final det(grad(y)), solver converged and the exit code are those of the returned solution.
  • The line search: in the code before this fix, the solution vector of Tao was the velocity field of the registration problem, which stores every point at which the objective is evaluated. Each trial step of a line search that shortens the Newton step \(s\) therefore moved the iterate \(x\): the trial points were \(x + s, x + 1.5s, x + 1.75s, \ldots\) (toward \(x + 2s\)) instead of \(x + s, x + s/2, x + s/4, \ldots\). Optimizer now gives Tao its own vector. In the binary search above, which starts the solver for each beta from a nearby solution, the line search then failed for five of the betas tried on one rank and three on two; the search treated them as too small and returned beta = 5.5 on one rank. The command line test checks that, in the line searches of this run, the objective at steps below 1e-5 is that at the iterate (within 1e-4 relative; it was off by 5.6e-3).
  • With 16 time steps (--time-steps 16) and a relative gradient tolerance of 1e-2, the solver stalls near that tolerance (the third iteration reduces the gradient by 1%), consistent with the less accurate gradient for more time steps (see the derivative checks below).
  • On 2 and 4 ranks, a registration of two 32^3 image files (the template image of --synthetic 0 and its transport with the computed velocity) stalls: with --newton-rtol 1e-2, claire stops with exit code 3 (on one rank it converges). On 2 ranks, the step of the line search falls below 1e-3 after 6 iterations, at a relative gradient of 1.4e-2 (before the line search fix above: the line search failed after 12 iterations, at 1.6e-2; 4 ranks were measured only before the fix). The gradient on several ranks is less accurate (Lagrange instead of B-spline interpolation, see above). With the default tolerance (5e-2) it converges.

Derivative checks. gradient and hessian set up a registration problem whose reference image is the template transported by a synthetic velocity, and compare the gradient and the Hessian with finite differences of the objective and of the gradient. Both run for each model: the squared L2 distance with h1-seminorm-div (the default), h1-seminorm, h1-norm, h2-seminorm and h2-norm, and NCC with h1-seminorm-div and h2-seminorm, each with the class that claire uses for it. Both print a Taylor expansion table for a random direction \(w\) as a diagnostic; the pass/fail measures are:

  • gradient: the ratio of a central difference of the objective along \(w = g/\|g\|\) to \(w^\top g\), which is 1 for a consistent gradient; the check uses the largest deviation \(|\text{fd}/(w^\top g) - 1|\) over the step sizes \(h = 1, 3, 10\) (tolerance 0.25; measured at most 0.10). It catches missing scale factors, wrong signs, and factor-2 errors. Smaller steps are not used: the semi-Lagrangian interpolation on the GPU uses hardware texture filtering, whose interpolation weights have only 8 fractional bits (1/256 of a grid cell), and for \(h \le 0.1\) the measured ratio was off by up to 27%.
  • the returned gradient \(g\) already includes the Lebesgue measure \(h_d\) (in the regularization gradient and in the body force), i.e., it is the gradient of the discretized objective with respect to the nodal values; the derivative checks therefore use the plain inner product \(w^\top g\).
  • hessian: the relative error of \(w^\top H w\) against a central difference of the gradient, \(w^\top(g(v + hw) - g(v - hw))/(2h)\), and against a second-order central difference of the objective (the best over \(h = 0.1, 1, 10\); tolerance 0.05). The second is not checked for h1-seminorm-div (see the notes above).

Both use the squared L2 distance by default; select another distance measure with --distance (sl2, ncc), e.g. $BINDIR/claire-test gradient --distance ncc. --hessian full selects the full Newton Hessian, but the semi-Lagrangian solver does not implement it yet (PDE solver not implemented), so only the Gauss-Newton Hessian (gauss-newton, default) can be checked.

We have also implemented several high-level numerical checks to assess the performance of our methodology and ensure that the mathematical operators are correct.

The claire-benchmark binary allows users to (i) check the accuracy of the forward operator and (ii) report the runtime for evaluating several key mathematical operators. Use --help to see all options (--repeats <n> repeats each run). The main tests are the following:

  • check error of forward operator (solve the forward problem for \(v\) and \(-v\) and check error with respect to initial condition for \(t=0\))

    $BINDIR/claire-benchmark transport-error [options]   # (terror)
    

  • report runtimes for evaluating the forward operator, the gradient operator and the Hessian matvec.

$BINDIR/claire-benchmark forward [options]
$BINDIR/claire-benchmark gradient [options]
$BINDIR/claire-benchmark hessian-matvec [options]   # (hessmatvec)

The tests/debug options directly available within the claire binary are the following (use --help-all to see all options):

  • The default test in CLAIRE is to consider synthetic test problems. The user can select between several test problems of varying complexity with the option --synthetic i, where i selects the particular test case (valid values for i are 0, 1, ..., 5).

    $BINDIR/claire [other args] --synthetic 0
    

  • The user can control the verbosity level of claire with --verbosity 2 (or -v -v) (debug mode verbosity). This will, e.g., enable command window outputs such as the residual in each iteration of the Krylov subspace method used to compute the search direction (and much more).

    $BINDIR/claire [other args] --verbosity 2
    

  • The Newton--Krylov solver monitors several critical values during the course of the iterations. The user can see outputs such as

    • number of (Gauss--)Newton iterations.
    • trend of the objective value (has to decrease monotonically)
    • trend of the gradient norm (should decrease but not necessarily monotonically)
    • number of line search steps (should be 1 for a Newton method subject to accuracy requirements)
    • and much more...
  • The accuracy of the symmetry of the discretized Hessian operator can be monitored by enabling the --check-hessian-symmetry flag in claire: Notice that we consider an optimize-then-discretize approach and numerical schemes that do not preserve symmetry; consequently, in our current implementation, the Hessian is only symmetric up to the discretization error of the adjoint operators (~1e-2).

    $BINDIR/claire [other args] --check-hessian-symmetry
    

  • The approximation accuracy of the gradient and Hessian can be monitored by enabling the --check-derivatives flag in claire. We report the assymptotic behavior of the Taylor expansion. The approximation error should decrease with decreasing perburbation (i.e., the error should converge). However, we do, in general not expect to observe quadratic or cubic convergence (as we would if we considered a discretize-then-optimize approach).

    $BINDIR/claire [other args] --check-derivatives