We use
We then train a neural network (NN) to learn the mapping from galactic parameters to chemical abundances to replace
Finally we use the NN to train a NPE to infer the galactic parameters from the chemical abundances.
Our goal is to infer the global galactic parameters (initial mass function high-mass slope
The data used to train the NN and NPE is created with chempy_test_data.py
.
Firstly we train a neural network to learn the mapping from chemical abundances to galactic parameters. For this we use data created with
The NN is trained on
The NN is a simple feed-forward neural network with
That is sufficient for the accuracy of the generated data, since its absolute percantage error (APE) of
It took around
Secondly we use the NN to train a Neural Posterior Estimator (NPE).
The network is a masked autoregressive flow (MAF) with
For that a total of
The accuracy is afterwards tested with the
The NPE is has an absolute percantage error (APE) of
The accuracy for a single prediction of the parameters is not really high. That's why we use multiple stars from the same galaxy to infer the global galactic parameters
Finally we sample from the posterior distribution to infer the global galactic parameters.
For that we use the chemical abundances of
The first set is created with the NN trained on data created with the TNG yield set.
The second set is created from
The third set is data created with the TNG simulator.
We can compute the posterior for a single star from the samples from the NPE.
Because of the central limit theorem, we can write the posterior for a single star as a multivariate Gaussian.
This gives us the mean and covariance of
We can then combine the posterior for multiple stars to get the posterior for the entire dataset.
This is a product of Gaussians, so the posterior for the entire dataset is also a Gaussian with mean
As expected, the inferred parameters deviate from the ground truth for a sigle prediction, since the NPE has a high error rate,
but is able to infer the global parameters with a high accuracy for a growing number of stars in the case where we used data created with the correct yield set
that the posterior was trained on.
The prediction for the TNG simulator seems also to be quite close to the ground truth.
The deviation is higher for the alternative yield set, since the NN was trained on the TNG yield set and the NPE is not able to generalize to other yield sets.
The total inference time for
The total time from training the NN emulator to the final inference is less than half an hour.