hombit commited on
Commit
c99cb0d
·
verified ·
1 Parent(s): f5e3d15

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +98 -0
README.md ADDED
@@ -0,0 +1,98 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ tags:
3
+ - astronomy
4
+ - time-series
5
+ - light-curves
6
+ - onnx
7
+ library_name: onnx
8
+ ---
9
+
10
+ # ATAT
11
+
12
+ **Part of the [light-curve](https://github.com/light-curve) family of open-source tools for astronomical time-series analysis.**
13
+
14
+ Available from Python via the [`light-curve`](https://light-curve.snad.space/) package: `pip install light-curve`. Documentation: [light-curve.snad.space](https://light-curve.snad.space/).
15
+
16
+ ## Paper
17
+
18
+ Becker, I., Pignata, G., Förster, F., Estévez, P. A., Cabrera-Vives, G., Vera, E., Carrasco-Davis, R., Astorga, N., Sanchez-Saez, P., Catelan, M., Cortés, C. C., de Jaeger, T., Pezoa, F., & Reyes, I. (2024). *ATAT: Astronomical Transformer for time series And Tabular data*. Astronomy & Astrophysics, 691, A163.
19
+
20
+ ```bibtex
21
+ @article{atat2024,
22
+ author = {Becker, I. and Pignata, G. and F{\"{o}}rster, F. and
23
+ Est{\'e}vez, P. A. and Cabrera-Vives, G. and Vera, E. and
24
+ Carrasco-Davis, R. and Astorga, N. and Sanchez-Saez, P. and
25
+ Catelan, M. and Cort{\'e}s, C. C. and {de Jaeger}, T. and
26
+ Pezoa, F. and Reyes, I.},
27
+ title = {{ATAT}: Astronomical Transformer for time series And Tabular data},
28
+ journal = {Astronomy \& Astrophysics},
29
+ year = {2024},
30
+ volume = {691},
31
+ pages = {A163},
32
+ doi = {10.1051/0004-6361/202451418},
33
+ }
34
+ ```
35
+
36
+ ## Original code
37
+
38
+ <https://github.com/alercebroker/ATAT> (git submodule at `models/atat/code/`)
39
+
40
+ ## License
41
+
42
+ Apache-2.0 (Copyright 2026 ALeRCE Collaboration) — matching the upstream
43
+ [alercebroker/ATAT](https://github.com/alercebroker/ATAT/blob/main/LICENSE)
44
+ repository, which adopted a license following
45
+ [alercebroker/ATAT#2](https://github.com/alercebroker/ATAT/issues/2). See
46
+ [LICENSE](LICENSE).
47
+
48
+ ## Model overview
49
+
50
+ ATAT is a Transformer-based encoder for irregularly-sampled, multi-band astronomical light curves. The light-curve branch processes all six photometric bands jointly: each band's observations are independently embedded via a learned time modulation (sinusoidal Fourier basis), then all bands are merged, sorted by observation time, and passed through a 3-layer multi-head self-attention transformer. A learnable CLS token is prepended; its output at position 0 is the default representation. ATAT was trained for transient classification on the ELAsTiCC simulation (20 classes, LSST-like photometry).
51
+
52
+ Default configuration: 3 attention layers, 4 heads, head dimension 48 (d_model = 192), up to 65 observations per band, 6 bands, embedding dimension 192.
53
+
54
+ ## Input data format
55
+
56
+ The model was trained on the ELAsTiCC simulation dataset which emulates LSST photometry in 6 bands (u, g, r, i, z, Y). Each light curve is represented as a multi-band time series of flux measurements.
57
+
58
+ ## Preprocessing steps
59
+
60
+ Prepare inputs using the same pipeline applied during training (`get_lc_md.py`):
61
+
62
+ 1. **Split by band.** Separate observations into 6 per-band sequences in the order `[u, g, r, i, z, Y]`. Each band gets an independent sequence of `(time, flux)` pairs.
63
+
64
+ 2. **Pad or downsample to 65 per band.** If a band has fewer than 65 observations, right-pad with zeros to length 65. If a band has more than 65 observations, downsample to 65 by selecting indices `linspace(0, n−1, 65)` (uniform subsampling, not truncation). The result is `data [65, 6]` and `time [65, 6]`; padding positions hold `0.0`.
65
+
66
+ 3. **Set the mask.** Set `mask = 1` for every slot containing a real observation and `mask = 0` for every padding slot. This is a direct validity indicator — set it based on how many real observations each band has, not derived from flux values.
67
+
68
+ 4. **Shift time to start at zero.** Subtract the minimum observed time (across all bands, ignoring padding slots) from all valid time entries. Padding time slots remain `0.0`. Supply time in **days**; the model's internal time modulator uses `T_max = 1500` days, so it is calibrated for light curves spanning up to roughly four years.
69
+
70
+ 5. **No flux normalisation.** Pass raw flux values without any normalisation. The model was trained on SNANA FLUXCAL with reference zero point ZP = 27.5 (a source at 27.5 AB mag has FLUXCAL = 1). Inputs from a different photometric system or flux scale are outside the training distribution and may produce poor embeddings.
71
+
72
+ ## Inputs (ONNX)
73
+
74
+ | Tensor | Shape | Description |
75
+ |--------|-------|-------------|
76
+ | `data` | `[batch, 65, 6]` | Per-band flux, SNANA FLUXCAL (ZP = 27.5), no normalisation |
77
+ | `time` | `[batch, 65, 6]` | Per-band observation times in days, shifted so earliest valid observation = 0; padding slots = 0 |
78
+ | `mask` | `[batch, 65, 6]` | **1 = valid observation, 0 = padding** |
79
+
80
+ ## Outputs (ONNX)
81
+
82
+ Single file `atat.onnx` with three named outputs:
83
+
84
+ | Output name | Shape | Description |
85
+ |-------------|-------|-------------|
86
+ | `token` | `[batch, 192]` | CLS token at position 0 after transformer (used in the paper) |
87
+ | `mean` | `[batch, 192]` | Masked mean pooling over per-observation features |
88
+ | `sequence` | `[batch, 65×6, 192]` | Per-observation features (CLS token excluded) |
89
+
90
+ Request only the output(s) you need via `session.run(["token"], feed)` — onnxruntime will prune unused computation.
91
+
92
+ ONNX opset: 13.
93
+
94
+ ## Weights
95
+
96
+ Source: [Google Drive — results\_paper.zip](https://drive.google.com/drive/folders/1uVOSJ1WMJH3o-5Czqx0WBcdmtf548GQ1?usp=sharing)
97
+ Training dataset: ELAsTiCC (DESC LSST simulation, 20 transient classes)
98
+ Checkpoint: `results/lc/Exp_cfg_-arch=lc-seed=0/`