pypesto.profile.profile_next_guess

Functions

adaptive_step(x, par_index, par_direction, ...)

Group of more complex methods for point proposal.

clip(vector_guess, lower, upper)

Restrict a scalar or a vector to given bounds.

do_line_search(next_x, step_size_guess, ...)

Perform the line search.

fixed_step(x, par_index, par_direction, ...)

Most simple method to create the next guess.

get_reg_polynomial(n_profile_points, ...)

Compute the regression polynomial.

handle_profile_history(x, par_index, ...)

Compute the very first step direction update guesses.

next_guess(x, par_index, par_direction, ...)

Create the next initial guess for the optimizer.

next_x_interpolate(next_obj, last_obj, ...)

Interpolate between the last two steps.

pypesto.profile.profile_next_guess.adaptive_step(x, par_index, par_direction, options, current_profile, problem, global_opt, order=1)[source]

Group of more complex methods for point proposal.

Step size is automatically computed by a line search algorithm (hence: adaptive).

Parameters:
  • x (ndarray) – The current position of the profiler, size dim_full.

  • par_index (int) – The index of the parameter of the current profile

  • par_direction (Literal[1, -1]) – The direction, in which the profiling is done (1 or -1)

  • options (ProfileOptions) – Various options applied to the profile optimization.

  • current_profile (ProfilerResult) – The profile which should be computed

  • problem (Problem) – The problem to be solved.

  • global_opt (float) – log-posterior value of the global optimum

  • order (int) – Specifies the precise algorithm for extrapolation: can be 0 ( just one parameter is updated), 1 (last two points used to extrapolate all parameters), and np.nan (indicates that a more complex regression should be used)

Returns:

The updated parameter vector, of size dim_full.

Return type:

x_new

pypesto.profile.profile_next_guess.fixed_step(x, par_index, par_direction, options, problem)[source]

Most simple method to create the next guess.

Computes the next point based on the fixed step size given by default_step_size in ProfileOptions.

Parameters:
  • x (ndarray) – The current position of the profiler, size dim_full.

  • par_index (int) – The index of the parameter of the current profile

  • par_direction (Literal[1, -1]) – The direction, in which the profiling is done (1 or -1)

  • options (ProfileOptions) – Various options applied to the profile optimization.

  • problem (Problem) – The problem to be solved.

Returns:

The updated parameter vector, of size dim_full.

Return type:

x_new

pypesto.profile.profile_next_guess.next_guess(x, par_index, par_direction, profile_options, update_type, current_profile, problem, global_opt)[source]

Create the next initial guess for the optimizer.

Used in order to compute the next profile point. Different proposal methods are available.

Parameters:
  • x (ndarray) – The current position of the profiler.

  • par_index (int) – The index of the parameter of the current profile.

  • par_direction (Literal[1, -1]) – The direction, in which the profiling is done (1 or -1).

  • profile_options (ProfileOptions) – Various options applied to the profile optimization.

  • update_type (Literal['fixed_step', 'adaptive_step_order_0', 'adaptive_step_order_1', 'adaptive_step_regression']) – Type of update for next profile point: fixed_step (see fixed_step()), adaptive_step_order_0, adaptive_step_order_1, or adaptive_step_regression (see adaptive_step()).

  • current_profile (ProfilerResult) – The profile which should be computed.

  • problem (Problem) – The problem to be solved.

  • global_opt (float) – Log-posterior value of the global optimum.

Returns:

The next initial guess as base for the next profile point.

Return type:

next_guess