pyttb.gcp_opt
Generalized CP Decomposition.
- pyttb.gcp_opt.gcp_opt(data: tensor | sptensor, rank: int, objective: Objectives | Tuple[Callable[[ndarray, ndarray], ndarray], Callable[[ndarray, ndarray], ndarray], float], optimizer: StochasticSolver | LBFGSB, init: Literal['random'] | ktensor | Sequence[ndarray] = 'random', mask: tensor | ndarray | None = None, sampler: GCPSampler | None = None, printitn: int = 1) Tuple[ktensor, 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
Objectives
gaussian()
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()
- pyttb.gcp.optimizers
- pyttb.gcp.samplers