Skip to main content

QNPy_Latte

Latent ATTEntive Neural Processes for Quasar Light Curves with parametric recovery

By Aman Nadimpalli Raju, Andjelka Kovacevic, Marina Pavlovic, Dragana Ilic, Iva Cvorovic-Hajdinjak (SER-SAG-S1 team)

QNPy_Latte_Logo

Introduction

Many of the secrets of quasars lie hidden within their variations. Analysis of quasar light curves can unlock some of these secrets, giving a holistic view of the region around the central black hole engine, as well as properties of the black hole. However, studying quasar variability itself is a challenge. The stochastic nature of the variations, coupled with the need for short cadence observations over a long period, make analysis difficult.

The LSST (Legacy Survey of Space and Time) will provide a plethora of quasar light curves, with short cadence observations throughout its 10 year run. However, there will be seasonal gaps in the observations, to keep up with the LSST goal of surveying the entire Chilean night sky. In order to utilize the LSST data for variational analysis, it is imperitive to model this data to fill in these gaps. To process the amount of data coming in, any such model should be non-parametric, computational inexpensive, data-driven, and capable of interpolation. We also would like to draw insights from the hidden layers of these models. Thus, we utilize Latent Attentive Neural Processes (AttnLNPs).

As part of the Serbian In-Kind software contribution to the LSST team (SER-SAG-S1), we present the QNPy Latte package to model and determine parameters (especially the transfer function) of quasar light curves. This work has been done by the guest student Aman N. Raju as part of his masters thesis and presented at the following:

Parts of this thesis have been presented as:

• “A Deep Learning Approach for Understanding Quasar Light Curves in the Legacy Survey of Space and Time" - Symposium Mathematics and Applica- tion, Faculty of Mathematics, University of Belgrade, 2023

• “QNPy and QhX Workshop” - LSST AGN Science Collaboration Quarterly Report, March 2024

• “Attentive Latent Neural Processes for modeling Quasar Variability in the LSST” - LSST TVS Colloquium, 21st May 2024

• “Pay Attention: Neural Processes with Latent Spaces and Attention to model Quasar Light Curves for the LSST” - XIII SAW, Astronomical Society “Ruđer Bošković", 18th May 2024

• “UPGRADING QNPY: MODELLING QUASAR LIGHT CURVES IN LARGE SURVEYS” - VI Conference on Active Galactic Nuclei and Gravitational Lensing, Zlatibor Mt., Serbia, June 02-06, 2024

• “Connecting the Dots: Attentive Latent Neural Processes” - 2nd MASS Summer School, Nice, France, July 2024 (First Prize 180s Thesis Talk)

• “LSST SER-SAG-S1: upgrade of QNPy package” - Catching supermassive black holes with Rubin-LSST: Towards novel insights and discoveries into AGN science, Torino, Italy, July 22nd-25th 2024

Furthermore, this repository will be used in the paper, Raju et. al. 2024 (in prep).

Latent Attentive Neural Processes

At SER-SAG-S1, we have used Conditonal Neural Processes (CNPs) to model quasar light curves (see QNPy). However, CNPs suffer from issues with underfitting and produce poor samples. Thus, the addition of attentive mechanisms and a latent path allow for an upgraded model.

The AttnLNP has two paths. One path is the deterministic path that operates similarly to CNPs to create a representation of the light curve. The input data (observation time and magnitudes) are encoded using a multilayer perceptron (MLP) to create a representation for each point. With the addition of self-attention, the points that are more important are weighted more highly in the representation. Then, the representations are used with the input and target times to create a attention weighted representation for each target time, allowing for flexible representations that can adapt to different datapoints.

The latent path operates similarly. However, the representations are simply averaged to create a global representation. This representation is passed through another MLP to generate a multidimensional gaussian latent space that can be sampled from. The latent space samples are combined with the determinstic representation to generate a combined representation for each target point in the light curve. These combined representations are passed through an MLP decoder to generate a predicted magnitude at each target time.

Original implementation from (https://arxiv.org/abs/1901.05761)[Kim et al. 2019]

In our model, we also include the possibility to encode the input and target times with an LSTM RNN layer in order to better reconstruct the quasar light curves as detailed in (https://arxiv.org/abs/1910.09323)[Qin et. al. 2019]

Self Organizing Maps

Just like QNPy, we incorporate Self Organizing Maps (SOMs) (see into our models to cluster the light curves before modelling. This serves a two-fold purpose. The dataset can be partitioned for quicker modelling and the resulting clusters are more balanced topologically than unclustered light curves. SOMs are an unsupervised model that can be customized to generate many clusters and easily updated to include new data without having to retrain the entire model.

SOMs are composed of a grid of nodes that assign a best matching unit (BMU) to each of the input points (in this case, light curves). Then it updates the BMU to move closer to the datapoint at a rate specified by the learning rate and the neighborhood function that controls the updating of the nodes around the BMU. Thus, the entire SOM node is trained on the input data and every datapoint can have a BMU. These BMUs can be clusters themselves or they can be grouped together by density analysis to generate larger but fewer clusters.

Our SOMs are based on the minisom package and follow the same implementation as QNPy. Through the use of SOMs, AttnLNPs and RNNs, we hope to create a multimodal approach to analyzing light curves.

Prediction of Parameters

Similar to Park et. al. 2021, we use the hidden representation of the light curve to infer parameters. We specifically include the ability to reconstructe the transfer function of the quasar, informing us of the properties of the region around the central black hole engine. We do this through attaching an MLP to the model either during training, or on an already trained model and train the model on theoretical transfer functions.

Thus, we are able to not just perform reconstruction of the light curve itself, but also analyze key properties about the system driving the quasar in a purely data-driven manner.

Installation

It is recommended to use a virtual enviornment with Anaconda to install QNPy_Latte. Please install one in Python 3.9 as:

conda create --name my_env -c anaconda python=3.9

Activate this enviornment and then install QNPy_Latte by:

pip install QNPy_Latte

It is recommended to use a virtual enviornment.

Tutorial Notebooks and Scripts

The associated GitHub contains tutorial notebooks and scripts that utilize the QNPy_Latte package to conduct the clustering and modelling of light curves. Please visit Our GitHub for more.

Metadata

Release files for QNPy-Latte 0.1.0.post2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for QNPy-Latte 0.1.0.post2
File Size Uploaded
qnpy_latte-0.1.0.post2.tar.gz 52.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for QNPy-Latte 0.1.0.post2
File Interpreter ABI Platform
QNPy_Latte-0.1.0.post2-py3-none-any.whl Python 3 none any Details

Total release size: 103.2 kB

Release files / qnpy_latte-0.1.0.post2.tar.gz

Download URL qnpy_latte-0.1.0.post2.tar.gz
Size 52.2 kB
Tags Source
SHA-256 checksum
How to use checksums
f1a7d873218ea53696000fab644d14f2df204f1d551542c10fed08f2944ba485
BLAKE2b-256 checksum
How to use checksums
dbd8ac48aa187249fcae1aa6ef916697eab1c1eee82d6863a9a1e507b6bd5f69
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.13.0

Release files / QNPy_Latte-0.1.0.post2-py3-none-any.whl

Download URL QNPy_Latte-0.1.0.post2-py3-none-any.whl
Size 51.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e6a25bceb4c2963205ce515281439e72fb9009687a8413d5b859956c33b48101
BLAKE2b-256 checksum
How to use checksums
2eb641707168eea6bce873235e0bb11a73e183f2fce26c04b16116a2db038347
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.13.0

Release history Release notifications | RSS feed

This release

0.1.0.post2 This release

2 release files

0.1.0

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page