-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't call factorize_linear_constraint
every time in _update_equilibrium
of ProximalProjection
?
#1404
Comments
This is not a true profile, but I threw So I think this could be a significant timesaver, if we can just pass in the A matrix of the factorization to the |
Can you share your script so I can run it on |
I think we should add an Then, in proximal, we would call eq.solve with the already wrapped and updated linear constraint projection rather than passing in the constraints each time |
I will send some profiles but it is hard to see them probably. So, maybe I can show you on Zoom if you want. Optimization with
|
Btw, I have noticed that The second factorization in perturbation can be made faster since I am not too familiar with that portion of the code, so sorry if there is any mistake. |
In |
Something like, (
xp,
A,
b,
Z,
D,
unfixed_idx,
project,
recover,
Ainv,
A_full_nondegenerate,
degenerate_idx, # maybe we need those for b_new
) = factorize_linear_constraints(
objective,
constraint,
)
b_new = -constraint.compute_scaled_error(0)
b_new = np.delete(b_new, degenerate_idx)
xp_new = jnp.zeros_like(xp)
fixed_idx = np.setdiff1d(np.arange(xp.size), unfixed_idx)
xp_new[fixed_idx] = b_new[fixed_idx]
xp_new[unfixed_idx] = Ainv @ (b_new-A_full_nondegenerate[:,fixed_idx] @ xp_new[fixed_idx])
recover = lambda x: xp_new + Z @ x |
Maybe in the Then pass this |
DESC/desc/optimize/_constraint_wrappers.py
Line 734 in 555a959
The text was updated successfully, but these errors were encountered: