PolyCoefMatrixHandler¶

class PolyCoefMatrixHandler¶

Bases: object

Compute and update polynomial coefficient matrices and vectors sequentially with addition of a new data set for the kernel-QA optimization.

Methods

__init__

Initialize coefficient matrices and vectors with the initial training data.

update

Update polynomial coefficient matrices and vectors sequentially with addition of a new data set.

Attributes

__init__(
init_x: ndarray,
init_y: ndarray,
kernel_func_mu: Callable,
kernel_func_sigma: Callable | None,
reg_param: float,
is_sigma_required: bool,
) None¶

Initialize coefficient matrices and vectors with the initial training data.

Parameters:
  • init_x (np.ndarray) – A list of the input value vectors in the initial training data.

  • init_y (np.ndarray) – Corresponding output values.

  • kernel_func_mu (Callable) – A kernel function for the mean.

  • kernel_func_sigma (Callable | None) – A kernel function for the sigma. When sigma is not considered throughout the optimization (beta = 0 or min(beta) = 0 in ModelKernel), set None.

  • reg_param (float) – A regularization parameter.

  • is_sigma_required (bool) – Whether the sigma is considered in the model (ModelKernel by default). See ModelKernel.is_sigma_required.

update(x: ndarray, y: ndarray) None¶

Update polynomial coefficient matrices and vectors sequentially with addition of a new data set.

Parameters:
  • x (np.ndarray) – All input value vectors in the training data (with the last element being a newly added input value vector).

  • y (np.ndarray) – Corresponding output values.

__dict__ = mappingproxy({'__module__': 'amplify_bbopt.trainer', '__doc__': 'Compute and update polynomial coefficient matrices and vectors sequentially with addition of a new data set for the kernel-QA optimization.', '__init__': <function PolyCoefMatrixHandler.__init__>, 'coef_matrix_mu': <property object>, 'coef_vector_mu': <property object>, 'coef_matrix_lxx': <property object>, 'coef_vector_sigma': <property object>, 'update': <function PolyCoefMatrixHandler.update>, '__dict__': <attribute '__dict__' of 'PolyCoefMatrixHandler' objects>, '__weakref__': <attribute '__weakref__' of 'PolyCoefMatrixHandler' objects>, '__annotations__': {'_gram_matrix_handler_sigma': 'GramMatrixHandler | None', '_coef_matrix_lxx': 'np.ndarray | None', '_coef_vector_sigma': 'np.ndarray | None'}})¶
__weakref__¶

list of weak references to the object (if defined)

property coef_matrix_lxx: ndarray | None¶
property coef_matrix_mu: ndarray¶
property coef_vector_mu: ndarray¶
property coef_vector_sigma: ndarray | None¶