Typical workflow for nonlinear models - 5.2 English - 68552

AOCL API Guide (68552)

Document ID
68552
Release Date
2025-12-29
Version
5.2 English

The standard way of computing a nonlinear model using AOCL-DA is as follows.

  1. Initialize a aoclda.nonlinear_model.nlls() object with some options set in the class constructor.

  2. Fit a nonlinear model to the data using aoclda.nonlinear_model.nlls.fit(). Here you will have to provide some functions that define the nonlinear model’s residual vector and a function to return the residual Jacobian matrix. The optimized parameters, \(x\), are modified in-place and returned on the interface of aoclda.nonlinear_model.nlls.fit().

  3. Extract results from the aoclda.nonlinear_model.nlls() object via its class attributes.

  1. Initialize a da_handle with da_handle_type da_handle_nlls.

  2. Pass the model to the handle using da_nlls_define_residuals_?.

  3. Customize the model using da_options_set_? (see below for a list of the available options).

  4. Train the nonlinear model using da_nlls_fit_? (you will have to provide an initial guess).

  5. Optimized coefficients \(x\) are returned on the interface.

  6. Extract results using da_handle_get_result_? using da_result_::da_rinfo.

    • The following results are available in the info[100] array:

      • info[0]: objective value,

      • info[1]: norm of objective gradient,

      • info[2]: number of iterations,

      • info[3]: reserved for future use,

      • info[4]: number of function callback evaluations (includes info[9]),

      • info[5]: number of gradient callback evaluations,

      • info[6]: number of Hessian callback evaluations,

      • info[7]: number of Hessian-vector callback evaluations,

      • info[8]: scaled gradient norm of objective,

      • info[9]: number of objective function callback evaluations used for approximating the derivatives or due to derivative checker,

      • info[10-99]: reserved for future use.