Skip to content

New sub-package for ML-based light-curve embeddings#692

Merged
hombit merged 4 commits into
mainfrom
embed
May 9, 2026
Merged

New sub-package for ML-based light-curve embeddings#692
hombit merged 4 commits into
mainfrom
embed

Conversation

@hombit
Copy link
Copy Markdown
Member

@hombit hombit commented May 7, 2026

No description provided.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.94%. Comparing base (0adec0b) to head (e4a2b5c).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #692   +/-   ##
=======================================
  Coverage   82.94%   82.94%           
=======================================
  Files          10       10           
  Lines        2720     2720           
=======================================
  Hits         2256     2256           
  Misses        464      464           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@hombit hombit force-pushed the embed branch 3 times, most recently from 46e1e2f to 8c52b8f Compare May 7, 2026 18:40
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented May 7, 2026

Merging this PR will improve performance by 14.42%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 1 improved benchmark
✅ 105 untouched benchmarks
⏩ 106 skipped benchmarks1

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation test_benchmark_lc_py 769.4 µs 672.4 µs +14.42%

Comparing embed (e4a2b5c) with main (0adec0b)2

Open in CodSpeed

Footnotes

  1. 106 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

  2. No successful run was found on main (e4a2b5c) during the generation of this report, so 0adec0b was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@hombit hombit marked this pull request as ready for review May 8, 2026 18:30
@hombit hombit changed the title Embed New sub-package for ML-based light-curve embeddings May 8, 2026
@hombit hombit force-pushed the embed branch 4 times, most recently from c52fab6 to 7c175e3 Compare May 9, 2026 13:47
hombit added 4 commits May 9, 2026 10:09
…base

Introduces the core infrastructure for the new `light_curve.embed` module:
- `TimeReduction` / `SingleSubsampleTimeReduction` / `MultipleTimeReductions` —
  abstract base and concrete strategies (Beginning, End, RandomSubsample,
  NonOverlappingWindows) for mapping variable-length light curves to fixed-length
  sequences
- `EmbeddingSession` / `SingleBandModel` — abstract ONNX session wrappers with
  preprocessing, masking, padding, and per-band dispatch
- `InputTensors` / `AstromerInputs` — typed dataclass containers for model inputs
- `Dim` — IntEnum of axis indices for the 4-D output array
- `Astromer1` / `Astromer2` — transformer encoders pretrained on MACHO light
  curves (Donoso-Oliva et al. 2023/2026), returning 256-d embeddings via ONNX
- `create_onnx_session` — helper with actionable ImportError for missing runtimes
- `from_hf()` classmethod for one-call download from HuggingFace Hub
- Tests covering preprocessing, output shapes, reference-embedding cosine
  similarity, and round-trip session equivalence
- CHANGELOG entry
TimeReduction had no specific connection to time; Reduction is cleaner.

- `TimeReduction` → `Reduction`
- `SingleSubsampleTimeReduction` → `SingleSubsampleReduction`
- `MultipleTimeReductions` → `MultipleReductions`
- `time_reduction_from_str` → `reduction_from_str`
- `time_reduction` parameter/attribute → `reduction` throughout
- `time_reduction.py` → `reduction.py`
@hombit hombit enabled auto-merge May 9, 2026 14:11
@hombit hombit disabled auto-merge May 9, 2026 14:11
@hombit hombit enabled auto-merge May 9, 2026 14:11
@hombit hombit merged commit 19435ef into main May 9, 2026
52 checks passed
@hombit hombit deleted the embed branch May 9, 2026 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant