pyttb.gcp.fg_est
Evaluate Functions And Gradients based on Subsamples.
- pyttb.gcp.fg_est.estimate(model: ttb.ktensor, data_subs: numpy.ndarray, data_vals: numpy.ndarray, weights: numpy.ndarray, function_handle: Literal[None], gradient_handle: function_type, lambda_check: bool = True, crng: numpy.ndarray | None = None) list[numpy.ndarray][source]
- pyttb.gcp.fg_est.estimate(model: ttb.ktensor, data_subs: numpy.ndarray, data_vals: numpy.ndarray, weights: numpy.ndarray, function_handle: function_type, gradient_handle: Literal[None] = None, lambda_check: bool = False, crng: numpy.ndarray | None = None) float
- pyttb.gcp.fg_est.estimate(model: ttb.ktensor, data_subs: numpy.ndarray, data_vals: numpy.ndarray, weights: numpy.ndarray, function_handle: function_type, gradient_handle: function_type, lambda_check: bool, crng: numpy.ndarray | None) tuple[float, list[numpy.ndarray]]
- pyttb.gcp.fg_est.estimate(model: ttb.ktensor, data_subs: np.ndarray, data_vals: np.ndarray, weights: np.ndarray, function_handle: function_type | None = None, gradient_handle: function_type | None = None, lambda_check: bool = True, crng: np.ndarray | None = None) float | list[np.ndarray] | tuple[float, list[np.ndarray]]
Estimate the GCP function and gradient with a subsample.
- Parameters:
model – Current decomposition.
data_subs – Subscripts of data sample.
data_vals – Values of data sample.
function_handle – Handle to evaluate objective function.
gradient_handle – Handle to evaluate gradient of objective function.
lambda_check – Whether or not to check decomposition weights are all ones. (Which is assumed in implementation details)
crng – Range of indices for correct/adjustment when zeros are sampled accidentally.
- Returns:
Estimated objective function value and/or estimated gradient value with
respect to the model.
- pyttb.gcp.fg_est.estimate_helper(factors: list[ndarray], subs: ndarray) tuple[ndarray, list[ndarray]][source]
Extract model values at sample locations and exploded Zk’s.
- Parameters:
factors – Factor matrices from model.
subs – Subscripts to extract from model.
- Returns:
Model values at subs and exploded Zk’s