Generalized CP Optimization (pyttb.gcp_opt)
Note
The gcp_opt function defined in gcp_opt.py has been promoted to the pyttb namespace.
- pyttb.gcp_opt(data: ttb.tensor | ttb.sptensor, rank: int, objective: Objectives | tuple[function_type, function_type, float], optimizer: StochasticSolver | LBFGSB, init: Literal['random'] | ttb.ktensor | Sequence[np.ndarray] = 'random', mask: ttb.tensor | np.ndarray | None = None, sampler: GCPSampler | None = None, printitn: int = 1) tuple[ttb.ktensor, ttb.ktensor, dict][source]
Fits Generalized CP decomposition with user-specified function.
- Parameters:
data – Tensor to decompose.
rank – Rank of desired CP decomposition.
objective – Objective function to minimize for the CP decomposition. Either a pre-defined objective or a tuple of function_handle, gradient_handle, and lower_bound.
optimizer – Optimizer class for solving the decompistion problem defined.
init – Initial solution to the problem.
mask – A binary mask to note missing rather than sparse data. (Only valid for dense, LBFGSB solves)
sampler – Class that defined sampling strategy for stochastic solves.
printitn – Controls verbosity of printing throughout the solve
- Returns:
Solution, Initial Guess, Dictionary of meta data
- pyttb.gcp.fg
- pyttb.gcp.fg_est
- pyttb.gcp.fg_setup
- pyttb.gcp.handles
Objectivesgaussian()gaussian_grad()bernoulli_odds()bernoulli_odds_grad()bernoulli_logit()bernoulli_logit_grad()poisson()poisson_grad()poisson_log()poisson_log_grad()rayleigh()rayleigh_grad()gamma()gamma_grad()huber()huber_grad()negative_binomial()negative_binomial_grad()beta()beta_grad()ztp()ztp_grad()
- pyttb.gcp.optimizers
- pyttb.gcp.samplers