release: cut v0.1.2 - #116
Merged
Merged
Conversation
…y calculations with in-place operations and pre-allocated buffers.
…update benchmark script, and add `_u_from_x` stub.
…sed by `target` and `target_prime`, including Cholesky factorization and degenerate case handling.
… cibuildwheel and OpenBLAS.
Feat/improve cpp memory performance
…include corresponding tests.
…les and installing libeigen3-dev.
…ra and a new `--build-info` command.
…ing missing backend and symbol handling
…ion()` when C++ backend is missing
Feat/replace with eigen cholesky
Chore/improve coverage
Introduces tangency_grad (single-pair gradient via envelope theorem) and pdist_tangency_grad (batch VJP pullback) as first-class public API. Includes 7 tests verifying analytic gradients against finite differences, and a topology-optimisation notebook demonstrating scipy L-BFGS-B usage. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add t=0 guard in tangency_grad to handle zero-distance (identical/ concentric) ellipsoid pairs without raising ZeroDivisionError - Mirror TangencyGrad, tangency_grad, pdist_tangency_grad in __init__.pyi so stubtest and typed imports work correctly - Fix notebook: use correct coef_from_axes(X, r0, r1, theta) API; replace unstable live optimization with a commented-out scipy wiring template Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The condition t == 0.0 is only reachable when p == q exactly, which is not a valid input. Removing the guard keeps the code honest. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…y_grad Explains why identical/concentric ellipsoids raise, which formula term is ill-defined, and why the error comes from solve_mu_gradients rather than the 1/(2t) factor. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replaces the placeholder in the topology optimisation notebook with a working example that drives gradient descent on ellipsoid centres using an H1 persistence-diagram loss computed by homcloud. Key design decisions (reviewed and approved by a mathematician): - Flag (clique) filtration on the tangency-distance matrix, framed as PH of a weighted dissimilarity graph (not metric VR PH, since t(P,Q) fails the triangle inequality in general). - Single H1 pair loss: L = (b - b*)^2 + (d - d*)^2 with a feasible target delta = min(0.2, 0.25*(d0-b0)). - Centre-only optimisation with fixed covariance preserves ellipsoid validity automatically; full raw-coefficient updates are avoided. - Gradient chain: grad_dists (sparse, float32-selected critical edges) -> vjp -> grad_coefs -> centre Jacobian J^T g. - find_unique_edge scans the float32 D matrix for unique birth/death edge matches; non-unique match stops the loop (degenerate step). homcloud 4.8.0 does not expose birth/death simplex vertex indices for Rips filtrations (RipsResolver.resolve_cells unimplemented), so this scan is the correct fallback under generic-position assumption. - Loop uses ordinary gradient descent on each locally smooth branch; heuristic continuation at pairing-switch events is documented. - Float32 approximation note: critical edges are selected from the float32 matrix but VJP pullback uses float64 tangency distances. Also removes the unused scipy.optimize boilerplate cell from Section 2. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- tangency_grad: normalize p/q with asarray+reshape(-1) before use, matching tangency()'s own input handling so list and row-vector inputs work correctly - pdist_tangency_grad: use _extract_coef_array() instead of plain asarray() to accept (N,1,m) arrays the same way pdist_tangency() does - Add three tests covering list, (1,m), and (N,1,m) input shapes Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Import _extract_coef_array was flagged by mypy because the symbol is absent from solver.pyi. Inline the equivalent logic instead, preserving the (N,1,m) flattening and the ndim != 2 rejection that guards the VJP against unsupported array layouts. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Feature/smart differentiable solver
…elated docstrings.
Adds coef_from_cov_grad(X, cov, *, scale) -> (coefs, vjp) to the grad module. The VJP maps upstream gradients on packed coefficients back to gradients on centers (N, d) and covariances (N, d, d) via the matrix inverse derivative identity. Works for arbitrary dimension d. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add end-to-end gradient recipe and conceptual background for the new differentiable geometry helper. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add coef_from_cov_grad: differentiable geometry with VJP
Add batch-size, squareness, and dimensionality checks matching coef_from_cov() so malformed inputs raise ValueError instead of silently broadcasting or returning NaN. Singular but well-formed covariances now return NaN coefficients with zero-gradient VJP, matching the forward-only fallback behavior. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Cover the new validation paths: batch size mismatch, non-square covariance, dimension mismatch (all ValueError), and singular covariance returning NaN with zero-gradient VJP. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Zero gradients falsely signal a stationary point to optimisers. NaN gradients are consistent with the NaN coefficients and correctly indicate an undefined derivative. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fix coef_from_cov_grad: validate inputs and handle singular covariances
feat: add direct ellipse cloud construction helpers
docs: curate unreleased release notes
ci: split docs build from deploy
Fix grad symmetry and release metadata gaps
…flow docs: clarify release workflow
release: bump version to 0.1.2
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Notes