himalaya.utils.compute_lipschitz_constants¶
- himalaya.utils.compute_lipschitz_constants(Xs, kernelize='XTX', random_state=None)[source]¶
Compute Lipschitz constants of gradients of linear regression problems.
Find the largest eigenvalue of X^TX for several X, using power iteration.
- Parameters
- Xsarray of shape (n_kernels, n_samples, n_features) or (n_kernels, n_samples, n_samples)
Multiple linear features or kernels.
- kernelizestr in {“XTX”, “XXT”, “X”}
Whether to consider X^TX, XX^T, or directly X.
- random_stateint, or None
Random generator seed. Use an int for deterministic search.
- Returns
- lipschitzarray of shape (n_kernels)
Lipschitz constants.