Commit 1f4a81a
feat: AnalysisEllipse.fit_from + JAX pytree registration
Wires AnalysisEllipse for end-to-end JAX traceability. Adds use_jax
flag (default True, matching AnalysisImaging), a fit_from method
returning a new FitEllipseSummed aggregate, and a lazy idempotent
_register_fit_ellipse_pytrees that registers FitEllipse,
FitEllipseSummed, DatasetModel, Ellipse, EllipseMultipole, and
EllipseMultipoleScaled as JAX pytrees on the first fit_from call.
log_likelihood_function now returns figure_of_merit (sum over the
per-ellipse fit_list) instead of log_likelihood, matching
AnalysisImaging exactly. The two differ by the noise_normalization
term per FitEllipse: figure_of_merit = -0.5 * (chi_squared +
noise_normalization), log_likelihood = -0.5 * chi_squared.
Step 7 of 7 in z_features/ellipse_fitting_jax.md — the keystone.
After this lands, ellipse modeling runs inside any JAX-compatible
search via AnalysisEllipse(dataset, use_jax=True).
Workspace follow-up flips prompt 2's workspace_test scripts to a
JIT round-trip with rtol=1e-4 parity against the locked-in numpy
reference numbers.
Issue PyAutoGalaxy#411.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 8e50837 commit 1f4a81a
4 files changed
Lines changed: 413 additions & 230 deletions
File tree
- autogalaxy
- ellipse
- model
- test_autogalaxy/ellipse/model
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| 68 | + | |
68 | 69 | | |
69 | 70 | | |
70 | 71 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
14 | 18 | | |
15 | 19 | | |
16 | 20 | | |
| |||
333 | 337 | | |
334 | 338 | | |
335 | 339 | | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
0 commit comments