APOGEENet¶
APOGEENet (also referred to as ANet or APOGEENet III) is a convolutional neural network pipeline that estimates fundamental stellar parameters from APOGEE spectra.
What it does¶
APOGEENet predicts three stellar parameters from an input APOGEE spectrum:
Effective temperature (Teff)
Surface gravity (log g)
Metallicity ([Fe/H])
It operates on both coadded and visit-level APOGEE spectra stored as ApogeeCoaddedSpectrumInApStar or ApogeeVisitSpectrumInApStar objects.
How it works¶
Network architecture¶
APOGEENet uses a deep residual convolutional neural network (ResNet) built in PyTorch. The architecture consists of:
Positional encoding – a 1D positional encoding is prepended to the flux, giving the network awareness of pixel position.
Initial convolution block – a 1D convolutional block (kernel size 30) that maps from 2 input channels (flux + positional encoding) to 4 output channels.
Four residual blocks – each block doubles the number of channels (4 -> 8 -> 16 -> 32 -> 64), using kernel size 30 with padding 15.
Adaptive average pooling – reduces the spatial dimension to a fixed length of 1024.
Fully connected layers – six linear blocks of dimension 1024, followed by a final linear layer that outputs 3 values (log g, log Teff, [Fe/H]).
Preprocessing¶
Before inference, the input flux is:
Converted from inverse variance to error (with handling for infinite/NaN values).
Log-scaled:
flux = log(clip(flux, min=1e-6)), then clipped at the 95th percentile + 1 to remove outliers.
Uncertainty estimation¶
Uncertainties are estimated via a Monte Carlo noise injection approach. The pipeline:
Draws
num_uncertainty_draws(default: 20) noise realizations by adding Gaussian noise to the flux based on the error spectrum.Runs each noised spectrum through the network.
Takes the standard deviation of the resulting predictions as the uncertainty estimate.
A post-hoc noise model is also applied to adjust the formal uncertainties:
e_teff = 1.25 * raw_e_teff + 10e_logg = 1.25 * raw_e_logg + 0.01e_fe_h = raw_e_fe_h + 0.01
Output conversion¶
The network internally predicts log(Teff), log(g), and [Fe/H] in a normalized space. These are unnormalized using pre-computed statistics (mean and standard deviation) and then converted:
teff = 10^(log_Teff)e_teff = 10^(log_Teff) * log_Teff_std * ln(10)(propagated from log-space)
Output fields¶
Field |
Type |
Description |
|---|---|---|
|
float |
Effective temperature (K) |
|
float |
Uncertainty in Teff (K), after noise model correction |
|
float |
Surface gravity (log10(cm/s^2)) |
|
float |
Uncertainty in log g, after noise model correction |
|
float |
Metallicity [Fe/H] (dex) |
|
float |
Uncertainty in [Fe/H] (dex), after noise model correction |
|
float |
Formal (raw) uncertainty in Teff before noise model |
|
float |
Formal (raw) uncertainty in log g before noise model |
|
float |
Formal (raw) uncertainty in [Fe/H] before noise model |
|
bitmask |
Bitfield encoding quality flags |
Flags¶
Flag |
Bit |
Description |
|---|---|---|
|
2^0 |
An exception was raised during runtime |
|
2^1 |
Teff is outside the range 1,700 – 100,000 K |
|
2^2 |
log g is outside the range -1 to 6 |
|
2^3 |
Teff < 3,200 K, or log g > 5, or [Fe/H] is outside -4 to +2 |
Summary flags¶
flag_warn: Set whenflag_unreliable_fe_his set.flag_bad: Set when any offlag_unreliable_teff,flag_unreliable_logg,flag_unreliable_fe_h, orflag_runtime_exceptionis set.
Caveats¶
The network was originally designed for BOSS optical spectra (“BossNet”) and adapted for APOGEE near-infrared spectra. The same ResNet architecture is used but trained on APOGEE data.
The [Fe/H] estimates are flagged as unreliable for cool stars (Teff < 3,200 K) and high-gravity stars (log g > 5), where the training data coverage is limited.
The reported uncertainties (
e_teff,e_logg,e_fe_h) include a post-hoc noise model correction. The raw (formal) uncertainties from Monte Carlo noise injection are stored separately asraw_e_*fields.GPU acceleration is used automatically when available.