Curvature utils
jnlr.utils.curvature_utils
tangent_space_basis
tangent_space_basis(nu: ndarray)
Return an orthonormal basis for the tangent space orthogonal to \(nu ∈ R^n\)
Source code in src/jnlr/utils/curvature_utils.py
5 6 7 8 9 10 11 12 | |
solve_lagrange_multipliers
solve_lagrange_multipliers(J: ndarray, delta_pi: ndarray, reg=1e-10)
Solve $$ J J^T λ = -2 J δ_π $$ for λ (m×m system). A small Tikhonov term reg·I protects against rank‑deficiency.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
J
|
ndarray
|
Jacobian matrix of shape (m, n) |
required |
delta_pi
|
ndarray
|
Difference vector of shape (n,) |
required |
reg
|
Regularization parameter |
1e-10
|
Returns:
| Name | Type | Description |
|---|---|---|
λ |
Lagrange multipliers of shape (m,) |
Source code in src/jnlr/utils/curvature_utils.py
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | |
min_tangent_eigenvalue_vv
min_tangent_eigenvalue_vv(f, jacobian_f, hessian_f, z_tilde: ndarray, z_hat: ndarray, eps=1e-06) -> jnp.ndarray
Generalization of min_tangent_eigenvalue to vector-valued constraint functions \(F: R^n -> R^m\). Computes the minimum eigenvalue of the combined Hessian projected to the tangent space.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
f
|
Constraint function |
required | |
jacobian_f
|
Function returning (m, n) Jacobian matrix DF(z) |
required | |
hessian_f
|
Function returning (m, n, n) Hessians of each component function f_i |
required | |
z_tilde
|
ndarray
|
Point at which to compute the curvature (projection of z_hat onto constraint surface) |
required |
z_hat
|
ndarray
|
Original point before projection |
required |
eps
|
Small constant to avoid division by zero |
1e-06
|
Returns: A pair (min_eigenvalue, ratio) where: - min_eigenvalue: Minimum eigenvalue of the combined Hessian projected to the tangent space - ratio: Ratio used for assessing the curvature condition
Source code in src/jnlr/utils/curvature_utils.py
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 | |
min_eigenvalue
min_eigenvalue(hessian_f, z: ndarray) -> jnp.ndarray
Compute the minimum eigenvalue of the Hessian of \(f\) at \(z\).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
hessian_f
|
Function returning the Hessian matrix of shape (n, n) |
required | |
z
|
ndarray
|
Point at which to compute the Hessian |
required |
Returns: Minimum eigenvalue of the Hessian
Source code in src/jnlr/utils/curvature_utils.py
134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 | |