Rapid Generation of Kilonova Light Curves Using Conditional Variational Autoencoder

The discovery of the optical counterpart, along with the gravitational waves (GWs) from GW170817, of the first binary neutron star merger has opened up a new era for multimessenger astrophysics. Combining the GW data with the optical counterpart, also known as AT 2017gfo and classified as a kilonova, has revealed the nature of compact binary merging systems by extracting enriched information about the total binary mass, the mass ratio, the system geometry, and the equation of state. Even though the detection of kilonovae has brought about a revolution in the domain of multimessenger astronomy, there has been only one kilonova from a GW-detected binary neutron star merger event confirmed so far, and this limits the exact understanding of the origin and propagation of the kilonova. Here, we use a conditional variational autoencoder (CVAE) trained on light-curve data from two kilonova models having different temporal lengths, and consequently, generate kilonova light curves rapidly based on physical parameters of our choice with good accuracy. Once the CVAE is trained, the timescale for light-curve generation is of the order of a few milliseconds, which is a speedup of the generation of light curves by 1000 times as compared to the simulation. The mean squared error between the generated and original light curves is typically 0.015 with a maximum of 0.08 for each set of considered physical parameters, while having a maximum of ≈0.6 error across the whole parameter space. Hence, implementing this technique provides fast and reliably accurate results.


INTRODUCTION
The concomitant discovery of the gravitational waves (GW) and optical counterpart electromagnetic waves (EM) (Soares-Santos et al. 2017;Lipunov et al. 2017;Tanvir et al. 2017;Arcavi et al. 2017;Valenti et al. 2017;Coulter et al. 2017) from the merger of the binary neutron star GW170817 (Abbott et al. 2017), also accompanied by short gamma-ray burst (GRB) (Goldstein et al. 2017;Savchenko et al. 2017), advanced the domain of multi-messenger astronomy.This optical counterpart, designated as kilonova (KNe) and known as AT2017gfo bolstered previous predictions of the existence of such electromagnetic transients (Li & Paczyński 1998;Rosswog et al. 1999).Prior to the discovery of GW170817, it was predicted that such an event would be accompanied by an EM counterpart, including short-duration GRBs (Eichler et al. 1989;Nakar 2007), emissions ranging from radio to X-rays pertaining to on or off axis afterglow (van Eerten & MacFadyen 2012;Coward et al. 2014;Fong et al. 2015;Lamb & Kobayashi 2016) and optical to near-IR resulting from the decay of r-process nuclei.A kilonova is an isotropic quasi-thermal transient which is powered by the radioactive decay, in the merger ejecta, of r-process nuclei, having luminosities 10 40 − 10 42 erg s −1 (Li & Paczyński 1998;Rosswog et al. 1999;Metzger et al. 2010;Barnes & Kasen 2013).This EM counterpart can provide deeper understanding of the merger environment and its products.When EM information is further combined with GW, it leads to a unique platform for an extensive understanding of such binary events.KNe models consists of one or more radioactive ejecta components that produce light curves peaking at different timescales and temperature depending on atomic mass number of the ejecta, and luminosity.The two-components consists of the blue KNe (Metzger et al. 2010;Roberts et al. 2011;Metzger & Fernández 2014) emission having poor lanthanide fraction (10 −5 ) in the merger ejecta peaking at a relatively earlier time scale and red KNe (Barnes & Kasen 2013;Kasen et al. 2013;Tanaka & Hotokezaka 2013) comprising of lanthanide-rich (10 −2 ) merger ejecta with peak values at later days.In the three-component model (Perego et al. 2017) there is an inclusion of purple KNe that describes the presence of purple KNe with a lanthanide fraction of 10 −3 .Various papers (Cowperthwaite et al. 2017;Villar et al. 2018) have provided the best-fit parameter for AT2017gfo related to the blue, purple and red kilonova in terms of ejecta mass, ejecta velocity and lanthanide fraction.However, since there has been only one GW-confirmed detection of a KNe from a merger of binary neutron stars, along with some possible candidates from other sources, it is difficult to understand and verify the properties of binary merging systems that emit electromagnetic radiation.An overview on the physical parameters that govern the KNe has been provided by Metzger (2019).
In recent years, machine learning has been used for various data analysis and formulating techniques required in astronomy (Vander Plas et al. 2014;Ball & Brunner 2010;Ntampaka et al. 2021;Jones et al. 2022).There has been certain areas where the application of machine learning techniques has produced a remarkable result, especially focusing on providing a relatively faster results alternative to the existing methods (Ball 2011;Sipőcz et al. 2020).There are plenty of excellent literature available on different topics of machine learning application in astronomy and astrophysics spanning over wide range of topics (Li et al. 2022;Gheller & Vazza 2022;García-Jara et al. 2022;Sheng et al. 2022).In this paper, we incorporate a method from ML domain known as autoencoder (Rumelhart et al. 1986), which is based on feed-forward mechanism, to generate light curves.The primary task of an autoencoder is to encode the input into a lower dimensional latent representation and then decode it back to data.In feed-forward mechanism, the neural network has unidirectional processing of information.The striking feature for an autoencoder is that the encoder compresses the high-dimensional input to a low-dimensional latent space and the decoder decompressed to produce result to match the input.
In this work, we regenerate the KNe light curves by implementing a conditional variational autoencoder (CVAE) (Kingma & Welling 2019), which is developed based on variational autoencoeder (VAE) (Kingma & Welling 2013).We use this CVAE to generate light curves based on our choice of physical parameter values of the binary merging system.For the CVAE, once the training has been completed, we are more flexible to rapidly generate light curves based on the physical parameters depending on choice of the data set.Although, KNe data from only two models for training and producing the results are used in this work, it is also possible to extend the same idea for data from other models.Although the data have been produced from the model, this unique data analysis technique can not only generate light curves for the parameter values that are not explicitly mentioned in the model but can also replace time-consuming and resource-draining simulations required for predicting the light curves.The novelty of this technique is expressed in the fact that once the CVAE is trained on a KNe model, we can generate numerous light curves for a different combinations of physical parameters in a very short time.An alternative approach for such conditional variational autoencoder and KNe work has been presented in Lukošiūtė et al. (2022) where different method has been studied for obtaining results.One of the fundamental differences between Lukošiūtė et al. (2022) and our work is in using spectra rather than light curves during the training.In our method, we look into the light curve evolution with respect to different sets of physical parameters aiming to complete the process in a relatively shorter time-scale compared to the existing simulation methods.This kind of rapid generation technique for KNe light curves can be useful when used as template for rapid parameter estimation of KNe.
In the following sections, we show the gradual implementation of our idea, and the results are discussed thereafter.In Section 3, we discuss the CVAE architecture implemented in our work.Section 4 puts forward the differences in the data and their physical parameters used for training and generation of the KNe light curves.Section 5 provides the detailed discussion of results obtained after implementation of CVAE.In Section 6 we summarize our approach and present some important features of this technique.Additional results for references are included in the appendix.

KILONOVA MODELS
Kilonova emission results from the mass ejection in the NS mergers (Freiburghaus et al. 1999;Ruffert, M. & Janka, H.-Th. 2001;Hotokezaka et al. 2013).The properties of the ejecta such as the ejecta mass, ejecta velocity and opacity dominates the peak luminosity and the time of the peak luminosity (Li & Paczyński 1998;Kasen et al. 2013Kasen et al. , 2015;;Barnes & Kasen 2013;Tanaka et al. 2017).This luminosity is sourced from the radioactive decay of the r-process elements synthesized in the merger.This work primarily focuses on two KNe models having different physical parameters that determine the light curves.Below we provide an outline of the two models used in this work.In Kasen et al. (2017),the light curves are dependent upon the peak magnitude and decay time with respect to the ejecta mass, velocity and lanthanide fraction is provided.Quantitatively, peak luminosity to first order is denoted by L ∝ M ej and the width of the light curve is τ ∝ (κM ej /v ej ) 1/2 , pointing to lanthanide-rich ejecta with higher κ, where M ej , v ej and κ are the mass, velocity and opacity of the ejecta.Hence heavier ejecta from the merger leads to higher peak magnitude with relatively longer duration KNe whereas ejecta with higher velocities have short duration with bright KNe.We see that lanthanide fraction plays a major role on the light curves where the ejecta with lower lanthanide fraction decays on a relatively shorter timescale compared to lanthanide-rich ejecta decaying over weeks.From the literature in Nicholl et al. (2021), the study presents an approach where light curves are predicted from the chirp mass, mass ratio, orbital inclination also including the properties related to the nuclear equation of state.Here we see the nature of light curves based on these physical parameters.It is important to note that, (Kasen et al. 2017) is based on radiative transfer model, where as (Nicholl et al. 2021) is a semi-analytic model.While KNe light curves can be generated with CVAE, we choose these models due to their different parametrizations and the data availability.However, this does not put any limitations on the use of CVAE, since data from any other available KNe models can be equally used.

AUTOENCODER
With the advancement of new machine learning (ML) methods and their implicit application in data analysis, has opened a new era where ML techniques can be implemented to obtain relatively faster results.Timeconsuming and resource-draining simulations can be completed on a reasonable time scale (Carleo et al. 2019).There are many available ML techniques that can be used for data analysis with specific techniques built to obtain certain results.We use an autoencoder, an ML technique that is based on a feed-forward mechanism, and its function is to reproduce the input.As is the case with any standard autoencoder, the CVAE consists of three sections, an encoder, a latent space, and a decoder, as shown in Fig. 1.The encoder (Q(ϕ)) compresses the high-dimensional input data into a lowerdimensional latent space while capturing the features of the input data.Latent space(Z ), which is also referred to as the output of encoder, has a lower dimensional representation.Generally, a well-trained CVAE has the entire high-dimensional input data smoothly distributed over the latent space.To generate light curves of our choice, we draw samples from this latent space and pass it through the decoder where the decoder (P (θ)) takes the compressed representation and generates the required light curves.This facilitates using CVAE as a tool, not only limited to a generative model but also quickly look into the parameter dependency of KNe light curves.In CVAE, the training is regularised in order to avoid over-fitting.Hence, the latent space is well distributed to enable generative process Even though there are other generative models like Generative Adversarial Networks (GAN) (Goodfellow et al. 2014) but since in our work we want to sample new data from the probability distribution of the input data, to look at the model parameters crucial for the light curves, we prefer to utilize the strength of an autoencoder because of its ability to have a probability distribution of input.
Even though GAN and CVAE are both generative models and belongs to the category of unsupervised learning, one of the primary differences lies in there architecture where GAN has a generator and discriminator and CVAE has encoder, latent space and decoder.Along with this, the loss functions used in GAN and CVAE are different from each other.It is important to note that for generating new data, sampling a hidden state in GAN takes place from a predefined distributions and is then fed into the discriminator in contrast to that of CVAE where sampling of hidden state, to be fed into the decoder, is done from selecting a prior distribution related to the actual data.Here, to achieve our goal, we take advantage of the conditional variational autoencoder, where we train it on the light curves by conditioning them on physical parameters and generate new light curves based on the physical parameters of our choice.In this case, we have complete control over the generated data set.In this work, we take advantage of this feature of CVAE to generate new data.In our Saha et al.
CVAE architecture, the loss function is the combination of the reconstruction-loss and the Kullback-Leibler divergence (Asperti & Trentin 2020).Training is carried out with batch size = 50 for epochs = 1000 and having a learning rate of 0.0001.Commencing from the training till generation of the light curves for the different physical parameter values, it takes ≃ 20 minutes for the process to complete using 3.9 GHz 8-core Intel Core i9 processor with 32 GB memory.In our training and regeneration of the light curves, we have not used the GPU of the system and have completely relied on the CPU.Once the model is trained and saved, it takes only a few milliseconds to generate the light curves.In this section, we outline the CVAE without delving into the details, however, for more detailed variational encoder readers can refer to (Kingma & Welling 2013) and (Kingma & Welling 2019).In Section 5 more insight into the results obtained from CVAE are shown.

DATA
In the ML domain, one needs to be very careful about the data that is fed into the algorithm.The data have to be pre-processed and prepared accordingly.The data used for training, validation and test set are categorized into two types as mentioned in Section 2. We adopt the data (https://github.com/dnkasen/KasenKilonova Models 2017), hereafter D 1 (Kasen et al. 2017) to prepare our data set to be fed into the CVAE.The physical parameters in this data set are ejecta mass (0.001 − 0.1M ⊙ ), ejecta velocity(0.1 − 0.3c) and lanthanide fraction(10 -4 -10 -9 ).There are 329 light curves with duration of ≈ 25 days.Each light curve has different values of the physical parameter within the range mentioned above.The light curves are available for different filter bands (u,g,r,y,z) within the same physical parameter range.Using these data, 241 light curves are used as training sets, and the rest are equally divided into the test set and the validation set.In our analysis, we have trained the CVAE on each filter band data separately, hence there are five trained CVAE's, and carried out light curves generation; however, in the main sections, only the g-band results are shown; the rest are added in appendix.
The second type of data, hereafter D 2 , used here consists of simulated light curves at same the filter bands but having different physical parameters.The physical parameters of these data are the chirp mass of the binary system, the mass ratio, the fraction of the remnant disk that is ejected, the viewing angle in degrees from the pole, and the opening angle of the cocoon shock (Nicholl et al. 2021).The range of values are (0.7M ⊙ − 2.0M ⊙ ) for the chirp mass, (0.5 − 1.0) for the mass ratio, (0.15 − 0.45) for the fraction of the remnant disk, respectively.For viewing angle the data corresponds to the values of 0°, 60°and 90°.There are 529 light curves having temporal length of 30 days, out of which 401 light curves are included in the training data and the rest are equally divided into test and validation set.The difference in the two data set is appears in the physical parameters used in the respective KNe models.These data are used to verify the pliability of the CVAE.Since the physical parameters in the two data sets used are entirely different, this gives an extra edge in verifying our approach, and the results are detailed in Section 5. Since both data sets contain light curves that have different absolute magnitude peak values, while feeding them for training, we have scaled the light curve data and the physical parameters between 0 and 1, as this would be a more effective approach.Later, after training and generating light curves, we rescale the light curves and plot accordingly.Throughout the paper, we will follow a particular format to represent the physical parameters in the text and in the legends of the plots.For the texts and plots relevant to D 1 , we will use the format where a,b and c will be the values of ejecta mass in M ⊙ , velocity of the ejecta in units of velocity of the light and lanthanide fraction respectively.Similarly for the D 2 , we will use the format of [w, x, y, z] where w is the chirp mass in units of M ⊙ , x is the mass ratio, y gives the fraction of the remnant disk that is ejected and z is the viewing angle in degrees from the pole.We will use the above format throughout the paper wherever required, without further mentioning the respective units.

Input Data
Output Data . Schematic diagram of the conditional variational autoencoder, consisting of the encoder, latent space and the decoder, from input to data generation is shown.In the figure, we have the probabilistic encoder Q(ϕ) and the probabilistic decoder P (θ).Z represents the compressed input or encoded representation.Here, the encoder transforms the high-dimensional input data, into the low-dimensional latent space which represents the compressed form of the high-dimensional input data while the decoder maps this compressed representation in the low-dimensional latent space leading to the reconstruction of the original high-dimensional data.We take a set of data x, which is the KNe light curves and condition it on a given parameter y, which in our case are the physical parameters from the model, and then the encoder compresses this representation in the latent space.
The decoder decompresses the representation and provides the relevant output data, KNe light curves, based on the physical parameter values of our choice.This is an overview of the CVAE architecture that has been used in this work to train and generate the KNe light curves.
the remnant disk and the viewing angle from the pole for D 2 .Throughout the text, D 1 and D 2 will be referred to accordingly, keeping the above training, test, and validation set unchanged.In  2, covers the parameter space but is previously unseen to the CVAE.The CVAE will be employed with these sets of physical parameters to generate light curves and hence compare with the true light curves, thus providing a robust approach to appraise the CVAE performance.Hence, using the CVAE, we generate light curves over a grid on the parameter space.

RESULTS
In this section, we present the results after the implementation of CVAE.After training, samples are drawn from the latent space to reconstruct light curves based on the required physical parameters.This section points out the comparison between the generated light curves from the latent space and the original light curves from the simulation.This technique allows us to generate as many light curves as we require over a wide range of physical parameters within the range provided by the model.
ejecta velocity, and lanthanide fraction, respectively as mentioned in Section 4. The loss plot for the CVAE is shown in Fig 3(b).We find that the validation loss and the training loss has decreased to a point of stability and there is small gap between the two curves.Although, CVAE has the ability to generate as many light curves we want for one or many physical parameters, but in order to avoid congestion in plots, we limit ourselves to 100 generated light curves based on the above physical parameter.The 100 light curves are closely spaced and

Data
Physical Parameters Data Features

D † 2
Chirp Mass (M ⊙ ) 1.0, 1.2, 1.4, 1.6, 1.8 Mass Ratio 0.7, 0.75, 0.8, 0.85, 0.9 Fraction of the Remnant Disk 0.15, 0.20, 0.25, 0.30, 0.35, 0.40 Viewing Angle 45°,60°, 75°, 90°T able 2. This table contains the interpolated physical parameters that were used to simulate light curves using MOSFIT and compare those with the CVAE-generated light curves.Light curves from these physical parameters, alongside from the test set, are employed to evaluate the performance of the CVAE over the parameter space.the apparent variations at the later days comes from the variations of the probability distribution in the latent space.These variations are expected since, to regenerate light curves, we randomly draw samples from the latent space.This randomness allows the CVAE to produce variations in the light curves even for the same input.Thus, we see these variations in the CVAEgenerated light curves for the physical parameters.Besides, the light curves are more sensitive to the changes in the physical parameters in the later days.However, since we are more interested in the earlier KNe evolution, we restrict the plots to 14 days.This parameter is chosen from the simulated data in order to verify the robustness of the CVAE.It is clear that the input light curve, shown by diamond markers, used from the validation data of the CVAE is well within the limit of the regenerated light curves.This assures that the CVAE is well trained.In Fig. 3(a), we see some overlapping in the light curves, since the 100 generated light curves have relatively similar values.While generating these light curves, samples were drawn from different points in latent space.It is possible to generate as many light curves as desired and observe the possible variations from the latent representation.Since the encoder maps the input light curves to a probability distribution over the latent space.Hence, even though in the respective KNe models, there is one light curve associated with a single value of the physical parameter, implementing CVAE provides a comparatively wide range of light curve distribution for the same value of physical parameter arising from the latent representation.This variation of the generated KNe light curves are particularly interesting when the light curves are generated for an entirely new physical parameter set which the CVAE has not come across during training and validation.
Kilonova light curves are extremely sensitive to ejecta mass (Kasen et al. 2017).With the change in the ejecta mass, the peak value of the light curves increases and shifts to later days, which is explicitly shown in the top left, top right and bottom left panel in Fig. 4.This result is expected in accordance to the KNe evolution.In this figure, the comparative analysis for the different values of ejecta masses (0.02M ⊙ , 0.1M ⊙ and 0.03M ⊙ ) are shown keeping the ejecta velocity (0.03c) and lanthanide fraction (10 −9 ) unchanged.100 light curves are generated from the CVAE comparing with the original light curve for the above physical parameters.In the bottom right panel, light curve for an arbitrary parameter (0.025M ⊙ ,0.035c,10 −5 ) is shown.This physical parameter value configuration in not present in D 1 therefore we do not have any benchmark to validate it, however, with more data from the respective KNe model, this can be verified.Similar comparative analysis, for all other filter bands, showing the evolution of the light curves with the change in ejecta mass, ejecta velocities and lanthanide fractions are shown in appendix in Fig A1 .We next take the second data set, D 2 , with physical parameters of chirp mass, mass ratio, fraction of the remnant disk and viewing angle from the pole.We run the same analysis as above.As mentioned in Section 4, this data set has a total of 529 light curves, with the above physical parameters having values given as mentioned in Section 4. The training data has 401 light curves, and the remaining are equally divided into a test set and a validation set.In Fig 5, we demonstrate the application of the CVAE on D 2 where we have compared 100 light curves generated from CVAE with the original light curve for the physical parameter of [1.8M ⊙ , 0.9, 0.15, 90°] correlated to the chirp mass, the mass ratio, the fraction of the remnant disk and the viewing angle from the pole, respectively.This set of physical parameters is taken from the test data set The input light curve is within the distribution of the generated light curve which indicates that the CVAE is performing well and the training and regeneration of the light curves are successful.Fig. 6, shows the confidence plot for a set of physical parameter where it is important to mention that the neural network has not seen this set of physical parameter and hence from the similarity between the generated and true light curves we can substantiate the performance of the CVAE.Other relevant plots for different combination of physical parameter and the changes in the light curves corresponding to those for other filter bands are shown in Fig B1 in appendix.To measure the predictive accuracy of the trained CVAE, we use mean absolute error (MAE), where lower value corresponds to more accurate prediction, calculated using , where y i and ŷi are the true values and predicted values of the light curves of the test data and n is the total number of points drawn for each light curve from latent space.Alongside the above mean absolute error, we also calculate and plot the mean squared error (MSE) between the true and predicted light curve values using the equation where, n being the total number of data points and z i and ẑi are the respective values of true and CVAEpredicted light curves.

DISCUSSION
Since the CVAE depends on the input data, light curves from different KNe models can be used for training and the corresponding trained CVAE is saved for generating light curves.The input data contains both training data and physical parameters.This versatility of the technique provide a unique opportunity to test this on other data set.Using eq(1), we have the mean absolute error to be 0.0995 and 0.0339 for D 1 and D 2 respectively.The mean squared error for D 1 and D 2 calculated on the test data using eq(2) are found to be 0.00241 and 0.00153 respectively.
Compared to D 2 , the MAE for D 1 is higher, as the training data is relatively lower for D 1 .We not only successfully reconstructed the light curves for known values of physical parameters but also generated light curves for the physical parameters that are not present in the data set but are well within the range of the physical parameters values provided in the respective models.In Fig. 3, we presented the reconstructed light curves and the corresponding loss values for the CVAE.Consequently, based on these results, we proceed to generate light curves for different combinations of physical parameters and verify those as presented in Fig. 4 Absolute Magnitude Generated Figure 4.In this figure, we compare 100 light curves (solid lines) generated from CVAE with original the light curves (diamond marker) for physical parameter values having ejecta masses of 0.02M⊙(upper left),0.1M⊙(upperright) and 0.03M⊙(bottom left) keeping the ejecta velocity 0.03c and lanthanide fraction(10 −9 ) constant for all the generated light curves.These values of the physical parameter were chosen from the test set.In the bottom right panel, 10 light curves for an arbitrary physical parameter [0.025M⊙, 0.035c, 10 −5 ] is shown.All the generated and the original light curves corresponds to the g-band.
obtained results are consistent with the KNe evolution presented in the model.Comparing the plots in Fig. 3(a) and Fig. 4, as mentioned in Section 5, we can see more variations in the latter, and for the latter figure the light curves has been truncated to 14 days while in the former, CVAE-generated light curves are extended till the end.
For the plots generated from D 2 , since there has been no significant change related to astrophysical importance, we have truncated the light curves to 14 days.Model evaluation is performed with the test data, in the current work, we move a step ahead to evaluate the performance via the confidence interval (Fig. 6) and mean squared error (Fig. 7) between the CVAE-generated and true light curves by taking physical parameters from D 2 † which contains the physical parameters from the test set as well as the entirely new physical parameters that were absent in the training, test and validation set.Therefore, as previously mentioned in Section.4, we use the physical parameters combination from Table 2 to produce Fig. 7. Therefore, when evaluating the performance on these sets of previously unseen parameters, simulates the real scenario akin to observing a new kilonova.In Fig. 6, we represent the figure for the 90% confidence interval between the generated and true light curves in different filter bands of u,g,r,i,z and y having the chirp mass of 1.2M ⊙ , mass ratio of 0.7, 0.15 fraction of the remnant disk having a viewing angle of 60°.The true light curves for this set of parameters were not included in .Comparison for the true and generated light curves corresponding to D2.These 100 light curves are particularly from r-band generated from the CVAE where the comparison is shown with the respective physical parameter of chirp mass, mass ratio, fraction of the remnant disk and viewing angle from the pole having values of [1.8M⊙, 0.9, 0.15, 90°] respectively.The diamond marker corresponds to the true light curve, whereas the solid lines corresponds to the CVAE-generated light curves.The physical parameter for the true light curve is taken from the test set for verifying with the generated ones.
the training, test, or validation data set, thus this data is unseen to the network.To plot the confidence interval, we take the mean light curves from the 2000 CVAEgenerated light curve for the above physical parameter values [1.2M ⊙ ,0.7,0.15,60°] in each filter bands.Each result is highlighted with color-shaded region for each filter band including the true light curve.Here we see a good agreement between the true and generated light curves which provides supporting evidence in favour of the performance of CVAE.In addition to the above, we have calculated the mean squared error between the generated and true light curves where we have have obtained the error to be always between (0.015 − 0.08) for the set of physical parameters.To provide further evidence of CVAE performance, we illustrate the mean squared error calculated over the entire parameter space while considering the following values of physical parameters,1.0M⊙ ,1.2M ⊙ ,1.4M ⊙ ,1.6M ⊙ , and 1.8M ⊙ for the chirp mass region, 45°, 60°, 75°and 90°for viewing angle region, 0.15, 0.20, 0.25, 0.30, 0.35 and 0.40 for the fraction of remnant disk parameter and for the 0.70, 0.75, 0.80, 0.85 and 0.90 in mass ratio parameter for the different filter bands as shown in Fig. 7. To calculate the mean squared error, we have used the mean of 2000 CVAE-generated light curves and the true light curves for the respective sets of physical parameters.Fig. 7 consists of four frames, each having an inset, which show the error calculated for the respective value of physical parameter (along x-axis) across the parameter space of the other remaining physical parameters.For the chirp mass frame (upper left),error is calculated for the different chirp masses (1.0M ⊙ ,1.2M ⊙ ,1.4M ⊙ ,1.6M ⊙ ,1.8M ⊙ ) across the parameter space of viewing angle, mass ratio and the fraction of the remnant disk, grouped together for each value of chirp mass for the filter bands.For the viewing angle frame (upper right), for the values of 45°,60°,75°a nd 90°error is calculated across the chirp mass, mass ratio and fraction of the remnant disk and grouped accordingly.For calculating the mean squared error for the fraction of remnant disk, we have considered 0.15,0.20,0.25,0.30,0.35,and0.40 across the parameter space of chirp mass, viewing angle and mass ratio grouped in parameter values in different filter bands.
In the mass ratio frame (lower right), error is calculated for the mass ratio values of 0.70,0.75,0.80,0.85,and 0.90, across the parameter space of chirp mass, viewing angle and fraction of the remnant disk grouped accordingly.
For certain set of physical parameter in certain filter bands, tend to have comparatively high mean squared error value, thus adding more to the overall error.For instance, the above case can be seen in the viewing angle frame in Fig. 7 for 45°viewing angle in i-band.However, the overall error are considerably low.In the insets of Fig. 7, g-band results are shown where each dot refers to the mean squared error of a single light curve for the respective set of physical parameter across the parameter space.Here also, we find that for certain set of physical parameter, the error value is comparatively higher as evident from outliers in 1.8M ⊙ chirp mass, 60°viewing angle, 0.15 fraction of remnant disk and 0.80 mass ratio in the insets.In comparison to one-one mean squared error, the overall error is relatively higher as it includes all the parameter sets across the individual parameter considered.From the above result, we find the regions in parameter space for different filter bands where the CVAE has comparatively unsatisfactory results.In addition to the above, the network summary,

CONCLUSION
In this paper, we look into rapid generation of KNe light curves based on different physical parameters values while implementing CVAE.We present a methodological approach to our idea.In the initial stages, the performance check was carried out while inspecting the loss curves during the training and validation.We also evaluated the CVAE performance on different physical parameter from test data, hence perform rapid interpo-lation of light curves and subsequently provide evidence that the results are quite in agreement with the true light curves.However, in certain cases, while generating the light curves, we find that for D 1 , as compared to the original light curves, the generated light curves tends to deviate after 8 days but for D 2 we do not see such deviations in the later days.Here, we have used publicly available KNe data to provide a proof of our concept, but this does not put any limitation on this technique.This technique can also be used for similar kind of data analysis comprising of data related to other domain in astronomy and astrophysics.The striking point for such an approach is that it reduces the time which is required by simulations to rerun and reproduce similar results for different physical parameters every time.We train the data available and produce the desired results rapidly rather than adjusting the simulation code each time and the saved CVAE model can be used to generate the required KNe light curves.In this work, by speeding up the light curve generation by 1000 times, we have achieved rapid results.Besides the current application for KNe, the CVAE technique demonstrated above has prospective applications in a similar procedure where data are available for training, test and, validation.In the current work, since the detailed calculations of the simulation are not incorporated into the CVAE, we do not expect any new results, but at the same time, the trained-CVAE produces results without looking into the particulars of the simulation.An alternative approach for generating simulation results, with the help of machine learning tools, without actually re-executing those is presented here.Additionally, this method can accommodate other KNe models where data are available to be fed into the network.This kind of CVAE approach has also the potential to be utilized for rapid parameter estimation not only limiting to KNe but also for other astrophysical sources where rapid data analysis is required.

Software:
matplotlib (Hunter 2007), pandas(pandas development team 2020), tensorflow (Abadi et al. 2015), keras (Chollet et al. 2015 Fig. 2(a) shows 50 out of 329 original light curves from D 1 in the g-band for physical parameters corresponding to ejecta mass, ejecta velocity and lanthanide fraction with values ranging between 0.001−0.1M⊙ , 0.03−0.05cand 10 −4 −10 −9 respectively whereas in Fig 2(b), we show 50 out of 529 light curves corresponding to D 2 having physical parameters that of chirp mass (0.7−1.10M ⊙ ), mass ratio (0.5−1.0), fraction of the remnant disk (0.15 − 0.45) and having a viewing angle of 0°from the pole as mentioned in Section 4. In Fig. 2, we show the input light curves corresponding to D 1 and D 2 which is fed into the CVAE.During training and validation, scaled values of the KNe light curves and the conditional physical parameters are used for both D 1 and D 2 , and the obtained results are shown in absolute magnitude values.The input light curves for training from D 1 consist of 241 light curves and from D 2 has 401 light curves from the g-band.As previously mentioned, each light curve has different physical parameters corresponding to ejecta mass, ejecta velocity and lanthanide fraction for D 1 and chirp mass, mass ratio, fraction of Figure 2. (a)  In this plot, we represent only 50 KNe light curves of the g-band of D1 which are a part of the data set for training.These light curves consist of the mass of the ejecta, the velocity of the ejecta, and the fraction of lanthanide as physical parameters with values ranging between (0.001 − 0.1M⊙),(0.03− 0.05c) , (10 −9 − 10 −4 ) respectively.(b)In this plot, we show 50 light curves for g-band of D2 which are a part of the training data set.These light curves consists of chirp mass, mass ratio, fraction of the remnant disk with values ranging between (0.7 − 1.10M⊙), (0.50 − 1.0), (0.15 − 0.45) respectively and having a viewing angle of 0°as their physical parameters.This figure gives an outline of the KNe light curves and their decay time, which is used for training the CVAE.For the both data, the KNe light curves are in absolute magnitude.These light curves are scaled between [0-1] while feeding them into the CVAE for training, but, while representing the generated results, these light curves are scaled back to the absolute magnitude.

Figure 3 .
Figure 3. (a)This figure show light curves comparison corresponding to g-band after training and generation are implemented on D1.We display 100 light curves for physical parameter of ejecta mass, ejecta velocity and lanthanide fraction having values [0.001M⊙, 0.03c, 10 −5 ] and compare it along side the light curve from the test data for the same physical parameter.The original light curve is shown in diamond marker and is within distribution of the generated light curves shown by dashed lines.The deviations seen in the generated light curves arise due to the variations in the latent space.(b)This plot corresponds to the learning curve after implementing the CVAE.The gap between the two curves is small indicating a good-fit Figure 5.Comparison for the true and generated light curves corresponding to D2.These 100 light curves are particularly from r-band generated from the CVAE where the comparison is shown with the respective physical parameter of chirp mass, mass ratio, fraction of the remnant disk and viewing angle from the pole having values of [1.8M⊙, 0.9, 0.15, 90°] respectively.The diamond marker corresponds to the true light curve, whereas the solid lines corresponds to the CVAE-generated light curves.The physical parameter for the true light curve is taken from the test set for verifying with the generated ones.

Figure 6 .
Figure 6.This figure corresponds to the 90% confidence plot for the CVAE-generated and true light curves in the g,r,z,y,i and u bands that have the physical parameter of 1.2M⊙ chirp mass, 0.7 mass ratio, 0.15 fraction of the remnant disk and a viewing angle of 60°.True values of the light curves for the above parameter are represented by the solid lines in each color-filled region.We find quite satisfactory agreement between the true and CVAE-generated light curves.The light curves corresponding to the above parameters were taken from the D2 † data set and thus are entirely new to the CVAE for prediction and generation.
Fig C1 has been added in the appendix for reference.While comparing Fig. 3 and Fig. 4 for D 1 with results from D 2 in Fig .5, one will find similar deviations in the tail of the light curves after 10 days for the different sets of physical parameters shown in plots presented in the appendix(Fig B1).In the main text, only one such plot (Fig. 5) has been shown for a single set of physical parameter, where the deviations are comparatively less.One of the main reasons for such different deviations is distribution of the latent space owing to the difference in the number of training data, since D 1 has comparatively less training data than D 2 .

Figure 7 .
Figure 7.In this figure, we present the performance of the CVAE spanning over the whole parameter space of chirp mass (1.0M⊙ − 1.80M⊙),viewing angle(45°− 90°),fraction of remnant disk(0.15− 0.40) and mass ratio (0.70 − 0.90) in the u,g,i,r,z and y filter bands represented by the different colors bars grouped accordingly.The y-axis represents the mean squared values whereas in the x-axis we have the respective physical parameter values for which we have calculated the overall mean squared error in the different filter bands shown with different color bars.For the chirp mass frame(upper left), the mean squared errors for different filer bands are grouped by the chirp mass values, 1.0M⊙, 1.2M⊙, 1.4M⊙, 1.6M⊙, 1.8M⊙, while covering parameter space of viewing angle, mass ratio and fraction of the remnant disk.For the viewing angle frame(upper right), we show the error for 45°, 60°, 75°and 90°viewing angles calculated over the entire parameter values of chirp mass, mass ratio and fraction of the remnant disk.In the remnant disk frame(lower left), for the values of 0.15,0.20,0.25,0.30,0.35 and 0.40 fraction of remnant disk, errors are grouped in different filter bands encompassing the chirp mass, viewing angle and mass ratio.For the mass ratio frame(lower right), errors corresponding to mass ratio values of 0.70,0.75,0.80,0.85,and0.90 are shown as grouped bar plots across the parameter space of chirp mass, viewing angle and fraction of the remnant disk for the different filter bands.In the insets for all the frames, we show the CVAE performance over the entire parameter space, as discussed above, obtained from CVAE generated g-band light curves.Each dot in the inset corresponds to the calculated value of the mean squared error of a light curve for the relevant set of physical parameters.For each of the histograms corresponding to the different parameter space, error bars have been shown.The histograms without the error bar correspond to a single light curve that is available for calculating the mean squared error between the true and CVAE generated light curves.

Table 1
to evaluate the performance of the CVAE.We augmented the existing test set with these separately simulated light curves, hereafter D 2 †, to provide a robust performance check.The combination of the physical pa-rameters present in D 2 †, as shown in Table the European Research Council (ERC) under the European Union's Horizon 2020 research and innovation programme (grant agreement No. 948381) and by funding from the UK Space Agency.The authors are grateful to the valuable suggestions from He-Feng Hsieh, John Veitch, and Nicola De Lillo.