<?xml-model href='http://www.tei-c.org/release/xml/tei/custom/schema/relaxng/tei_all.rng' schematypens='http://relaxng.org/ns/structure/1.0'?><TEI xmlns="http://www.tei-c.org/ns/1.0">
	<teiHeader>
		<fileDesc>
			<titleStmt><title level='a'>Deep learning simulations of the microwave sky</title></titleStmt>
			<publicationStmt>
				<publisher></publisher>
				<date>12/01/2021</date>
			</publicationStmt>
			<sourceDesc>
				<bibl> 
					<idno type="par_id">10353174</idno>
					<idno type="doi">10.1103/PhysRevD.104.123521</idno>
					<title level='j'>Physical Review D</title>
<idno>2470-0010</idno>
<biblScope unit="volume">104</biblScope>
<biblScope unit="issue">12</biblScope>					

					<author>Dongwon Han</author><author>Neelima Sehgal</author><author>Francisco Villaescusa-Navarro</author>
				</bibl>
			</sourceDesc>
		</fileDesc>
		<profileDesc>
			<abstract><ab><![CDATA[We present 500 high-resolution, full-sky millimeter-wave deep learning (DL) simulations that include lensed CMB maps and correlated foreground components. We find that these MillimeterDL simulations can reproduce a wide range of non-Gaussian summary statistics matching the input training simulations, while only being optimized to match the power spectra. The procedure we develop in this work enables the capability to mass produce independent full-sky realizations from a single expensive full-sky simulation, when ordinarily the latter would not provide enough training data. We also circumvent a common limitation of high-resolution DL simulations that they be confined to small sky areas, often due to memory or GPU issues; we do this by developing a "stitching" procedure that can recover the large-scale, high-order statistics and avoid discontinuities or repeated features in the maps. In addition, since our network takes as input a full-sky lensing convergence map, it can in principle take a full-sky lensing convergence map from any large-scale structure (LSS) simulation and generate the corresponding lensed CMB and correlated foreground components at millimeter wavelengths; this is especially useful in the current era of combining results from both CMB and LSS surveys, which require a common set of simulations.]]></ab></abstract>
		</profileDesc>
	</teiHeader>
	<text><body xmlns="http://www.tei-c.org/ns/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink">
<div xmlns="http://www.tei-c.org/ns/1.0"><head>I. INTRODUCTION</head><p>The cosmic microwave background (CMB) has been a cornerstone of modern precision cosmology. The study of the primordial anisotropy imprinted on the CMB at the surface of last scattering has shed light on the physics of the early Universe. A rich set of secondary anisotropies induced by intervening large scale structures (LSS) and complex astrophysical phenomena has revealed a picture of the evolving Universe. As the sensitivity of CMB experiments has improved, more information has been obtained from these features. A few recent examples include the constraints on cosmological parameters from CMB power spectra <ref type="bibr">[1]</ref><ref type="bibr">[2]</ref><ref type="bibr">[3]</ref><ref type="bibr">[4]</ref><ref type="bibr">[5]</ref>, the measurement of CMB lensing auto spectra <ref type="bibr">[6]</ref><ref type="bibr">[7]</ref><ref type="bibr">[8]</ref>, and the study of kinematic and thermal Sunyaev-Zel'dovich effects <ref type="bibr">[9]</ref><ref type="bibr">[10]</ref><ref type="bibr">[11]</ref><ref type="bibr">[12]</ref>.</p><p>Current CMB data analyses rely heavily on simulations to (1) model the underlying physical processes, <ref type="bibr">(2)</ref> verify the data analysis pipeline, (3) investigate potential biases, and (4) generate covariance matrices used in likelihood analyses. As a result, there have been efforts to improve simulations of the microwave sky <ref type="bibr">[13]</ref><ref type="bibr">[14]</ref><ref type="bibr">[15]</ref><ref type="bibr">[16]</ref><ref type="bibr">[17]</ref><ref type="bibr">[18]</ref><ref type="bibr">[19]</ref><ref type="bibr">[20]</ref><ref type="bibr">[21]</ref><ref type="bibr">[22]</ref>. Current and future highresolution CMB experiments, such as the Atacama Cosmology Telescope (ACT) <ref type="bibr">[23,</ref><ref type="bibr">24]</ref>, the South Pole Telescope (SPT) <ref type="bibr">[25]</ref>, the Simons Observatory (SO) <ref type="bibr">[26]</ref>, CMB-S4 <ref type="bibr">[27]</ref>, and CMB-HD <ref type="bibr">[28,</ref><ref type="bibr">29]</ref> will observe large sky areas at arcminute resolution or better with unprecedented sensitivity. Analyzing the data from these observations will need many realizations of realistic simulations of comparable resolution and sky coverage. In particular, as the sensitivity of CMB experiments improves, simulations capturing the correlations between foreground components and non-Gaussian features will become ever more important.</p><p>Simulations of the millimeter-wave sky can be divided into several components: <ref type="bibr">(1)</ref> primordial CMB maps, (2) extragalactic foregrounds, and (3) Galactic foregrounds. The procedure to generate simulations of primordial CMB maps is well established and computationally efficient at arcminute resolution <ref type="bibr">[30]</ref><ref type="bibr">[31]</ref><ref type="bibr">[32]</ref><ref type="bibr">[33]</ref><ref type="bibr">[34]</ref>. The extragalactic foreground components include the lensing convergence field (&#954;), the kinetic and thermal Sunyaev-Zel'dovich effects (kSZ and tSZ), the cosmic infrared background (CIB), and radio galaxies (radio). There are a few extragalactic foreground simulations publicly available that include all the above non-Gaussian, correlated foregrounds at high-resolution over a large fraction of the sky <ref type="bibr">[19,</ref><ref type="bibr">22]</ref>. These simulations are generated by first making three-dimensional realizations of cosmological features, and then projecting them along the line-of-sight to make two-dimensional maps. To a large extent, these existing simulations can reproduce the statistics of the latest CMB observations. However, there are only a limited number of realizations available due to the high computational cost of generating initial three-dimensional realizations. As a result, many CMB analyses model extragalactic foregrounds as Gaussian random fields matched to the observed foreground power spectra (e.g., <ref type="bibr">[4]</ref><ref type="bibr">[5]</ref><ref type="bibr">[6]</ref>).</p><p>There have also been a number of efforts to simulate Galactic foregrounds in both intensity and polarization <ref type="bibr">[35]</ref><ref type="bibr">[36]</ref><ref type="bibr">[37]</ref><ref type="bibr">[38]</ref><ref type="bibr">[39]</ref><ref type="bibr">[40]</ref><ref type="bibr">[41]</ref><ref type="bibr">[42]</ref><ref type="bibr">[43]</ref>. Modeling the small-scale features of Galactic foregrounds is particularly challenging given the current lack of observations on comparable scales in millimeter wavebands, though there is progress in this direction <ref type="bibr">[44]</ref>. In this work, we focus on generating simulations including the primordial CMB and extragalactic foreground components, and leave inclusion of Galactic foregrounds to future work.</p><p>Recently, Machine Learning has found a broad application in cosmology; parameter estimation <ref type="bibr">[45]</ref><ref type="bibr">[46]</ref><ref type="bibr">[47]</ref><ref type="bibr">[48]</ref><ref type="bibr">[49]</ref><ref type="bibr">[50]</ref><ref type="bibr">[51]</ref><ref type="bibr">[52]</ref>, foreground cleaning <ref type="bibr">[42,</ref><ref type="bibr">43,</ref><ref type="bibr">53,</ref><ref type="bibr">54]</ref>, feature extraction <ref type="bibr">[55]</ref><ref type="bibr">[56]</ref><ref type="bibr">[57]</ref><ref type="bibr">[58]</ref>, inpainting <ref type="bibr">[59]</ref><ref type="bibr">[60]</ref><ref type="bibr">[61]</ref>, filtering <ref type="bibr">[62]</ref>, and modeling of physical processes <ref type="bibr">[43,</ref><ref type="bibr">[63]</ref><ref type="bibr">[64]</ref><ref type="bibr">[65]</ref><ref type="bibr">[66]</ref><ref type="bibr">[67]</ref><ref type="bibr">[68]</ref><ref type="bibr">[69]</ref>. Deep learning (DL) is a subset of machine learning that fits multiple nonlinear functions to the input data using neural networks. In particular, generative DL models aim at sampling the manifold (which can be highdimensional) where the input data lives, so that new points in that manifold are associated with new complex data with the same statistical properties as the desired input data. Recently, there have been many approaches in this direction <ref type="bibr">[42]</ref><ref type="bibr">[43]</ref><ref type="bibr">[44]</ref><ref type="bibr">[70]</ref><ref type="bibr">[71]</ref><ref type="bibr">[72]</ref><ref type="bibr">[73]</ref><ref type="bibr">[74]</ref><ref type="bibr">[75]</ref><ref type="bibr">[76]</ref><ref type="bibr">[77]</ref><ref type="bibr">[78]</ref><ref type="bibr">[79]</ref><ref type="bibr">[80]</ref><ref type="bibr">[81]</ref>. However, these methods are not yet widely used in CMB data analyses due to their limited sky-coverage or summary statistics mismatch.</p><p>In this work, we generate for the first time, many independent full-sky millimeter-wave DL simulations that include all correlated extragalactic foreground components appropriate for CMB analyses. We find that our MillimeterDL (hereafter mmDL) simulations are able to reproduce well the non-Gaussian statistics of the original input maps. Several recent works have focused on using various DL techniques to generate two-dimensional projected microwave fields from three-dimensional N-body simulations <ref type="bibr">[70,</ref><ref type="bibr">71,</ref><ref type="bibr">[73]</ref><ref type="bibr">[74]</ref><ref type="bibr">[75]</ref><ref type="bibr">[76]</ref><ref type="bibr">[77]</ref><ref type="bibr">[78]</ref><ref type="bibr">80,</ref><ref type="bibr">81]</ref>; in this work, we use two-dimensional projected simulations at 148 GHz described in <ref type="bibr">[19]</ref> (hereafter S10) as the input data to train our DL algorithm, as opposed to three-dimensional N-body simulations. This is suitable for generating maps for a CMB imaging survey, since most of the relevant information for CMB data analyses is contained in the two-dimensional projected maps. The advantage of our approach is that DL training in two dimensions is computationally more efficient than that in three dimensions; therefore, for a given computing resource, one can train on a larger footprint at higherresolution.</p><p>In particular, we use DL methods to generate 500 realizations of full-sky millimeter-wave simulations that match the statistics of the S10 simulations. Each of these 500 simulation realizations includes:</p><p>(1) a full-sky simulation at half-arcminute resolution at six different frequencies <ref type="bibr">(30,</ref><ref type="bibr">90,</ref><ref type="bibr">148,</ref><ref type="bibr">219,</ref><ref type="bibr">277</ref>, and 350 GHz).</p><p>(2) the lensed CMB in both temperature and polarization. (3) extragalactic foreground components appropriately correlated with each other, including: (i) the lensing convergence map (&#954;).</p><p>(ii) the kinetic Sunyaev-Zel'dovich effect (kSZ).</p><p>(iii) the thermal Sunyaev-Zel'dovich effect (tSZ).</p><p>(iv) the cosmic infrared background (CIB).</p><p>(v) the radio galaxies (radio). ( <ref type="formula">4</ref>) non-Gaussian information that reproduces statistics such as the one-point function, bispectra, and trispectra. These mmDL simulations are trained using the cosmology and extragalactic model described in S10 <ref type="bibr">[19]</ref>. However, the method presented here is general and can be applied to reproduce other two-dimensional simulations with minor modifications. In Sec. III, we present our procedure to generate the mmDL simulations. The comparison between the statistical properties of the mmDL and the S10 simulations is shown in Sec. IV. We discuss potential applications and the data products released in Sec. VI. These mmDL simulations are publicly available in both HEALPix 1 and CAR formats on the Legacy Archive for Microwave Background Data Analysis (LAMDA) 2 and the National Energy Research Scientific Computing Center (NERSC) cluster. 3 We also provide the code to produce additional realizations at <ref type="bibr">[82]</ref>.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>II. DL PRIMARY INPUT DATA</head><p>We generate our Primary Input Data from the S10 simulations, which include &#954;, kSZ, tSZ, CIB and radio <ref type="bibr">[19]</ref> extragalactic foreground components. The S10 simulations were generated by post-processing the output of a three-dimensional simulation, which has WMAP5 cosmology <ref type="bibr">[83]</ref>. The S10 simulations have correlated foreground components, and have been shown to have non-Gaussian statistics that match observations <ref type="bibr">[84]</ref><ref type="bibr">[85]</ref><ref type="bibr">[86]</ref><ref type="bibr">[87]</ref><ref type="bibr">[88]</ref>. The S10 simulations and source catalogs are publicly available on NASA's LAMBDA website (see Footnote 2). The simulations are saved in HEALPix format <ref type="bibr">[89]</ref> with Nside &#188; 8192, and have units of Jy/sr. The S10 &#954; map has Nside &#188; 4096, and is dimensionless.</p><p>We describe our procedure to prepare the mmDL primary input data below. Our procedure includes (1) pre-processing the original S10 148 GHz simulations, )</p><p>2 ) dividing the pre-processed S10 simulations into small patches, and (3) applying a normalization to the datasets to stabilize and speed up the training of a neural network.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>A. Preprocessing of the S10 Simulations</head><p>Below we detail the steps in our procedure to preprocess the original HEALPix S10 simulations for the network training.</p><p>(i) Following <ref type="bibr">[26,</ref><ref type="bibr">88]</ref>, we scale the flux of CIB sources and the tSZ map by a factor of 0.75 to make the S10 simulations more closely match recent measurements from ACT, Planck and SPT <ref type="bibr">[90]</ref><ref type="bibr">[91]</ref><ref type="bibr">[92]</ref><ref type="bibr">[93]</ref><ref type="bibr">[94]</ref>. (ii) We convert the units of the maps from Jy/sr to &#956;K, except for the &#954; map which is dimensionless. (iii) We reproject the &#954;, tSZ, and kSZ foreground components of the S10 simulations from HEALPix pixelization to plate carr&#233;e (CAR) pixelization at half arcminute resolution using the public pixell<ref type="foot">foot_0</ref> and libsharp <ref type="foot">5</ref> [95] libraries. Since CAR maps intrinsically consist of a grid of rectangular pixels, there is a natural way to extract two-dimensional submaps; this makes it simpler to train DL networks and apply two-dimensional Fourier transform operations. On the other hand, CAR pixels are increasingly oversampled farther away from the equator (the image is stretched), which we discuss below. The reprojection is done by converting the original HEALPix maps to spherical harmonic a lm up to an l max of 10,000. These a lm are then reprojected onto full-sky CAR pixelized maps. (iv) For the CIB and radio foreground components, we place sources directly from the S10 catalogs into full-sky CAR pixelized maps to avoid spectral leakage ("ringing") around pointlike sources when manipulating them in harmonic space. We apply a flux-cut of 7 mJy at 148 GHz to both CIB and radio CAR maps in order to match current and future CMB analyses that typically detect and remove bright sources. (v) Since CAR maps require the same number of pixels at each declination, the image appears stretched at the poles. To prevent the network from learning nonphysical features induced by this stretching, we use only the region of the simulations near the equator to train the network (from -10&#176;to 10&#176;in declination). However, in order to make use of all the sky area available in the S10 simulations, we rotate the full S10 map many times, redefining the equator of the map each time. In particular, we rotate each full-sky map by 15 degrees in &#968; and 20 degrees in &#952;, where &#968; and &#952; are the first two Euler angles. The successive rotations in &#968; and &#952; described above generate 25 unique cylindrical strips around each new equator, which strips in CAR projection have minimal image distortion compared to the sphere. For &#954;, tSZ, and kSZ, the rotations are done in spherical harmonic space. For CIB and radio, we simply remap source positions for given rotation angles.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>B. Division of full sky simulations into smaller patches</head><p>To train a network, we need many training samples. Since we start with a single realization of the full sky S10 simulation, we increase the number of samples by dividing this simulation into smaller overlapping patches. Below we detail our steps.</p><p>(i) We randomly pull out patches of 128 &#215; 128 pixels (roughly 1&#176;&#215; 1&#176;patches) between the declination of -10&#176;and 10&#176;. We cut out patches in this way from our 25 cylindrical strips (described above) for &#954;, tSZ, kSZ, CIB and radio maps. Thus each patch has five foreground components totaling an array of size 5 &#215; 128 &#215; 128. We repeat this step until we collect 30,000 validation samples (to pick initial parameters for the training), 200,000 training samples, and 30,000 test samples (to check the performance of the training). We ensure that we have an equal number of samples from the 25 rotated maps. We call the resulting dataset the primary input data. Note that these samples will necessarily have overlapping regions among them. We discuss our method to overcome this issue in Sec. III. (ii) During the network training, we randomly flip a sample either vertically or horizontally, or both as a natural way to augment the training dataset.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>C. Normalization to speed up and stabilize the training</head><p>We need to normalize the samples to stabilize and to speed up the neural network training. Since we have multiple foreground components in a single sample, the normalization needs to account for two issues. First, the pixel intensity probability density function (pixel PDF) of different foreground components follows different distributions. The pixel PDFs of tSZ, CIB, and radio roughly follow a Poisson distribution, whereas those of &#954; and kSZ are better described by a Gaussian distribution. Second, these pixel PDFs have varying dynamic ranges. For example, all the pixel values of the &#954; map fall between -1.5 and 1.5; on the other hand, the radio map has pixel values ranging from 0 to 852 &#956;K. Ideally, we would like the pixel PDFs to follow a standard Gaussian distribution (i.e., with unit variance) for faster and more stabile network training. To address the shape of the pixel PDF, we first perform a pixel-wise natural log scaling adopted from <ref type="bibr">[74]</ref>, to the tSZ, CIB, and radio maps. In particular, we replace the value of each pixel, given by v, with f&#240;v&#222; &#188; sgn&#240;v&#222; ln abs&#240;v&#222;</p><p>where sgn&#240;v&#222; is sign function, and &#963; v the standard deviation of the pixel PDF of the input map. After this normalization, the pixel PDFs of the tSZ, CIB, and radio maps are closer to a Gaussian distribution.</p><p>To mitigate the dynamic range issue, we then standardize the maps using the standard score method (i.e., subtract the mean of all the pixels from each pixel value and then divide that by the variance of the map).<ref type="foot">foot_3</ref> </p><p>Here, v 0 is the pixel value, and &#956; v 0 and &#963; v 0 are the mean and standard deviation of the pixel values respectively. <ref type="foot">7</ref> Note that each foreground component is normalized independently from the others. The parameter values used in the normalization procedure are shown in Appendix A. Note that each of these normalization operations has a welldefined inverse operation. When we generate the final products, we undo these normalizations prior to the interpolation procedures discussed in Sec. III D.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>III. METHOD</head><p>Generative adversarial networks (GANs) are a class of networks that will generate new data matching the statistics of the training dataset <ref type="bibr">[96]</ref>. Fundamental to a GAN is a set of two neural networks, called the generator and discriminator. A generator makes new data, while a discriminator tries to distinguish between the real data and the generated data. By iteratively training a generator and a discriminator, a GAN reaches an equilibrium where the discriminator can no longer distinguish new data from training data. For more discussion about GANs, we refer the reader to <ref type="bibr">[97,</ref><ref type="bibr">98]</ref>.</p><p>GAN models can only generate random samples limited to the same footprint as the training data. Since our primary input data consists of 1&#176;&#215; 1&#176;patches, the random samples output by the GAN do not have the full information about modes on scales larger than 1 degree (roughly l &#8804; 200). This presents a challenge in stitching together the small patches to make a full-sky simulation with the correct largescale fluctuations. Furthermore, there is no straightforward way to tile these random patches together to make a full-sky map without having discontinuities at the tile edges.</p><p>Instead, we train a conditional GAN network to predict the four extragalactic foreground components (tSZ, kSZ, CIB, and radio) from a &#954; map. Once this network training step is completed, we generate a full-sky Gaussian &#954; map, and convert it to the other four full-sky extragalactic components tile by tile. Since the input Gaussian &#954; maps is continuous, the resulting extragalactic foreground maps are also continuous. This image prediction approach also solves another major concern about using DL to generate new samples, which is mode collapse. Mode collapse is when the network predicts only a subset of all possible outcomes, instead of a continuous distribution. However, with our approach, since we provide a unique input full-sky &#954; map to the network for each full-sky realization the network outputs, we can ensure that the output maps are also unique.</p><p>A challenge of this predictive approach, which uses a conditional GAN model, is that it has a large number of parameters that need to be trained; thus this conditional GAN requires a much larger training dataset than simple GANs. Since our primary input data is relatively small and has over-lapping patches (see Sec. II for details), we first use the primary input data to train a simple GAN network (which is easier to train) to make a large sample of non over-lapping patches of &#954;, tSZ, kSZ, CIB and radio maps (intermediate product 1 in Fig. <ref type="figure">1</ref>). This larger dataset is then used to train a conditional GAN (training step 2 in Fig. <ref type="figure">1</ref>). After training step 2 is done, the network can now predict extragalactic foregrounds given a &#954; map. We input a unique full-sky Gaussian &#954; map into the network to generate the other extragalactic foreground components (tSZ, kSZ, CIB and radio) tile by tile (intermediate product 2 in Fig. <ref type="figure">1</ref>). The extragalactic components predicted from the Gaussian &#954; map will be missing some non-Gaussian information due to the missing non-Gaussian information in the &#954; map; thus, we introduce a simpler version of the conditional GAN that can restore this missing non-Gaussian information, which we train on the primary input data plus intermediate product 2. Once this training is done, the network is equipped to go from unique input full-sky Gaussian &#954; maps and unlensed CMB T, Q, and U maps to a full-sky simulation including non-Gaussian extragalactic foregrounds, a non-Gaussian &#954; map, and the corresponding lensed CMB T, Q, and U maps (T, Q, and U are the temperature and two polarization fields of the CMB). The schematic of the overall procedure is shown in Fig. <ref type="figure">1</ref>.</p><p>Since the extragalactic maps are statistically invariant under translation, a natural choice is to use a deep convolutional generative adversarial network (DCGAN) since it has convolution kernels that are also invariant under translation. In this work, we use three variations of the DCGAN: </p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>A. Training step 1: Learning on small patches with Wasserstein GAN with gradient penalty (DCWGAN-GP)</head><p>The DCWGAN-GP model we use is summarized by the generator depicted in Fig. <ref type="figure">2</ref> and the discriminator described in Table <ref type="table">I</ref>. We take the CosmoGAN network architecture used in <ref type="bibr">[72]</ref> as a starting point of our DCWGAN-GP network because it has been demonstrated to reproduce non-Gaussian statistics for a one-component map. From this starting point, we make the following adjustments. First, we switch the simple GAN loss function used in CosmoGAN with the Wasserstein loss function with gradient penalty introduced in <ref type="bibr">[99]</ref>; the loss function is the statistic that all GANs optimize. We find that this change of the loss-function substantially improves the stability of our network against mode-collapsing (i.e., against the network missing critical features). To be consistent with the standard Wasserstein GAN (WGAN) architecture, we remove the batch normalization layers (i.e., the intermediate normalization steps within the GAN) from the discriminator to stabilize the loss function gradient, and replace the sigmoid function activation layer with a linear function activation layer, following <ref type="bibr">[99]</ref>. In addition, we increase the depth of the convolution layers in both generators and discriminators from four to five, and we increase the latent-vector length (i.e., array size of input random numbers) from the original 64 to 256 in order to have a more expressive network. We also change the last activation layer in the generator model from tanh x to a &#195; tanh b=a &#195; x, which we call a scaled tanh. Here a is chosen to be 15 to accommodate the dynamic range of the normalized pixel values we obtained using Eq. ( <ref type="formula">1</ref>), while b is chosen to be 2 so that the gradient around the boundary values (i.e., -15 and 15) do not vanish too rapidly; we find the form of the scaled FIG. <ref type="figure">1</ref>. Shown is a schematic of the overall procedure to train the network and generate the output maps from the input data. The network is represented by the shaded gray box in the center. The mmDL procedure starts with the Primary Input Data consisting of 200,000 1&#176;&#215; 1&#176;overlapping patches cut out from the original S10 simulations. The pink boxes represent the three major training steps described in Sec. III. The blue boxes represent inputs into each training step. The dark grey arrows indicate the input and output of each step. Once the network training is completed, we feed full-sky Gaussian kappa maps and unlensed CMB maps (T, Q, U) into the network (top green box); given these inputs, the network generates the final output products (bottom green box), which are full-sky millimeter-wave simulations including lensed T, Q, and U maps, non-Gaussian kappa maps, and non-Gaussian extragalactic foregrounds correlated with the kappa map and each other.</p><p>tanh function and its parameters by checking the training statistics when using the validation set of patches (see Sec. II B). We also add a custom linear layer that linearly rescales each extragalactic component independently so that the network has more freedom to rescale the components relative to each other. We call this custom layer the "linear channel" (LC). We find that using this LC helps the network to converge faster. We reduce the two-dimensional convolution layer kernel size (i.e., the width and the height of a convolution filter) from 5 &#215; 5, used in CosmoGAN, to 4 &#215; 4 to account for the difference in the input image size from 256 &#215; 256 pixels to 128 &#215; 128 pixels (the latter is for 1&#176;&#215; 1&#176;patches at 0.5 arcmin resolution). Lastly, we replace the rectified linear unit (ReLU) layers in the generator with the leaky rectified linear unit (Leaky ReLU) with &#945; &#188; 0.2 to achieve better performance, as suggested by <ref type="bibr">[100]</ref>. (For more discussion about various types of activation functions, we refer to <ref type="bibr">[101]</ref>).</p><p>We train the DCWGAN-GP network with the primary input data using up to 100 epochs (i.e., the number of cycles through the entire training dataset used by the network during training). Following <ref type="bibr">[99]</ref>, we adopt a gradient penalty coefficient (&#955;) of 10 and the number of discriminator iterations per generator iteration (n critic ) of 5. For gradient decent, we use the Adam optimizer <ref type="bibr">[102]</ref> with a learning rate (lr) of 10 -4 and &#240;&#946; 1 ; &#946; 2 &#222; &#188; &#240;0.5; 0.9&#222;. Throughout this training, we check not only the loss function values, but also the visual images, Minkowski functionals, power spectra, cross spectra, and pixel PDFs of the network outputs; we will discuss each metric in Sec. IV. If the network shows signs of overfitting or mode-collapsing, we restart the training either from the beginning or after reducing the learning rate by half (i.e., effectively reducing the step size). We terminate the training cycle once all the statistics considered are satisfactorily reproduced. We use the trained DCWGAN-GP network to produce intermediate product 1 (800,000 1&#176;&#215; 1&#176;patches of non-Gaussian &#954; maps and correlated non-Gaussian foregrounds) which we use in training step 2. Note that the samples in intermediate product 1 are no longer overlapping and are statistically independent of each other.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>B. Training step 2: Generate extragalactic foregrounds from kappa map with Pix2Pix GAN (PIXGAN)</head><p>The PIXGAN model we use is summarized by the generator depicted in Fig. <ref type="figure">3</ref> and the discriminator described in Table <ref type="table">I</ref>. A PIXGAN can convert input images to other images by implementing a U-NET generator <ref type="bibr">[103,</ref><ref type="bibr">104]</ref>. We use the PIXGAN network to convert a given &#954; map to the other four non-Gaussian extragalactic foregrounds consisting of tSZ, kSZ, CIB, and radio components. We start with the original PIXGAN architecture presented in <ref type="bibr">[104]</ref>, and make the following modifications. We first replace the tanh  activation layer in the generator with a sequence of a linear channel and a scaled tanh; the latter two are defined in III A.</p><p>Since we terminate the training well before the network shows signs of overfitting, we also remove the drop-out layers from the generator to speed up the training. Lastly, instead of using the PatchGAN discriminator as in <ref type="bibr">[104]</ref>, we use the same DCWGAN-GP discriminator model described in Sec. III A, and summarized in Table <ref type="table">I</ref>. We use intermediate product 1 (800,000 1&#176;&#215; 1&#176;nonoverlapping patches of non-Gaussian &#954;, tSZ, kSZ, CIB and radio maps) generated by training step 1 to train the PIXGAN network. <ref type="foot">8</ref> We use the same optimizer setup as in training step 1. During the training process, we find that the PIXGAN network tends to overestimate the number of massive tSZ clusters, which results in an excess of tSZ power at large scales. To mitigate this effect, we add a linear loss term to the DCWGAN-GP generator loss function evaluation defined as the second term in the right side of the equation below.</p><p>where L DCWGAN-GP G is the standard DCWGAN-GP generator loss function defined in <ref type="bibr">[99]</ref>, and &#963; 2 &#240;S i &#222; is the total pixel variance of the ith foreground component in a sample. Since the sum of power spectra values across multipoles is the equal to the total pixel variance of the map (a corollary of Parseval's theorem), it follows that penalizing the difference in the total pixel variance is equivalent to penalizing the mismatch in the summed power spectra. We train the model with &#947; &#188; 100, and find that it helps to regulate the excess power in the tSZ map.</p><p>We train the PIXGAN network using up to 10 epochs. <ref type="foot">9</ref>We validate the network every 200,000 training samples (four times per epoch) with the updated loss function in Eq. ( <ref type="formula">3</ref>), checking the same metrics as in Sec. III A. We intentionally terminate early the training of the PIXGAN network for two reasons. First, once the PIXGAN network starts to overfit, the quality of the output degrades quickly. We find it more conservative to undertrain the PIXGAN network rather than to risk over-fitting. Second, we find that the VAEGAN network described in the next training step (training step 3) can absorb some imperfection in the simulations and correct for them. Therefore, the output from the PIXGAN network can have minor defects without affecting the quality of the final products. We terminate the training once we see signs of over-fitting; these signs are (1) minimal improvement of the loss function over the training samples, (2) large fluctuations of the other metrics with respect to the S10 simulations, and (3) images missing significant features. At this point, we choose the snapshot of the network that reproduces the summary statistics the best. In particular, for the power spectra, we check that the PIXGAN network can reproduce the shape of each foreground component power spectra up to a constant multiplication factor. <ref type="foot">10</ref> When this network snapshot reproduces the shape of the power spectra to within 10% for l &#8712; &#240;2000; 8000&#222;, and the cross spectra and Minkowski functionals also show similar agreement, we consider the training complete. Otherwise, we repeat the training procedure until we reach this criteria. After this training step is done, we feed in several full-sky Gaussian &#954; maps through the trained PIXGAN network, producing 200,000 1&#176;&#215; 1&#176;n onoverlapping patches of extragalactic foregrounds consisting of tSZ, kSZ, CIB, and radio components; we call this intermediate product 2. The full-sky Gaussian &#954; maps are generated using pixell; we use the power spectra of the S10 kappa map as the input spectra to these Gaussian kappa simulations.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>C. Training step 3: Restoration of non-Gaussian information with variational autoencoder GAN (VAEGAN)</head><p>The VAEGAN model we use is summarized by the generator depicted in Fig. <ref type="figure">4</ref> and the discriminator described in Table <ref type="table">I</ref>. Neural networks can be used to improve existing simulations, either by improving the resolution or by adding missing small-scale information <ref type="bibr">[44,</ref><ref type="bibr">105]</ref>. In this work, we adopt the variational autoencoder GAN (VAEGAN) in order to add back missing non-Gaussian information <ref type="bibr">[106]</ref>. Our VAEGAN generator architecture is similar to the U-NET generator architecture discussed in Sec. III B except for the following. Unlike the PIXGAN, the VAEGAN generator does not have skip-connections for each layer (i.e., there are no array concatenations for each layer like as shown by the dotted lines in Fig. <ref type="figure">3</ref>), except that we add back input maps from intermediate product 2 at the very end (see dotted line in Fig. <ref type="figure">4</ref>) as done in <ref type="bibr">[80]</ref>. This addition at the end allows the VAEGAN network to focus just on the missing non-Gaussian information (i.e., to focus on the residual difference between the network product of training step 3 and intermediate product 2). Another difference between the PIXGAN and VAEGAN generators are that the latter has fewer trainable parameters, which makes it easier to train; thus we only need 200,000 samples, as opposed to 800,000, to train it. Regarding the discriminator, we use the same DCWGAN-GP discriminator (i.e., the same Wasserstein loss function with the gradient penalty) discussed in Sec. III A, and summarized in Table <ref type="table">I</ref>. We closely monitor the tSZ statistics along with the loss function and other summary statistics. We terminate the training when all the statistics considered are within 5% for l &#8712; &#240;2000; 8000&#222;.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>D. Post-processing the network simulations</head><p>As discussed in Sec. III, we convert a full-sky Gaussian &#954; map to other foreground components tile by tile, where each tile is a 1&#176;&#215; 1&#176;flat patch of sky. Here, we describe our method to divide full-sky &#954; maps into tiles and to reproject the processed tiles back on to a full-sky map. When we sample a 1&#176;&#215; 1&#176;patch from a full-sky &#954; map, we rotate that patch to the celestial equator and then cut out a tile of size 128 &#215; 128 pixels with a 20-pixel overlap region between each tile as shown in Fig. <ref type="figure">15</ref> in Appendix B. This is similar to how we cut the original S10 simulations as discussed in Sec. II B. This results in a grid of tiles with 200 tiles along a longitudinal direction and 400 tiles along a latitude direction. 11 When we reproject the tiles back on to a full-sky map, we interpolate them back to the correct location on the sphere according to their coordinates. Here, we take advantage of the fact that CAR pixels in a full-sky map get stretched only along the latitude direction. As a result, the pixels in the longitudinal direction can be remapped without any interpolation. This effectively reduces the dimensions of the interpolation from two to one, which lowers the overall computational cost.</p><p>We use two different interpolation methods depending on which foreground component we would like to reproject. We use a linear interpolation to reproject the &#954;, tSZ, and kSZ foreground components because they are continuous fields. <ref type="foot">12</ref> To reproject the CIB and radio galaxies, we use the nearest neighbor method (i.e., each CAR pixel in the full-sky map obtains a value from the nearest pixel in the flat-sky tile). We use this method because linear interpolation can "blur" sharp variations in amplitude, which is not ideal for interpolating discrete point sources. We remove any superfluous negative flux sources before reprojecting point source tiles back onto the full-sky. Since we initially sample the full-sky &#954; map with overlapping regions, one pixel in the full-sky map can be mapped onto more than one flat-sky tile. Therefore, we precompute the number of mapped tiles for each full-sky map pixel and construct an effective "hit-counts" map. If more than one tile corresponds to a single full-sky pixel, then we add the tile pixel values and divide by the hit-counts map to obtain an average. In addition, we apodize each tile with a cosine apodization mask prior to the full-sky reprojection as done in <ref type="bibr">[44]</ref> to suppress any discontinuity around the edges; this is done by weighting the overlapping regions by the apodization mask to downweight pixels closer to the edges of a given tile. <ref type="foot">13</ref> Lastly, following Sec. IV. 3 in <ref type="bibr">[107]</ref>, we compute two-dimensional transfer functions to correct for the reprojection effects for the &#954;, tSZ, and kSZ maps. Note that we do not apply two-dimensional transfer functions to the CIB and radio maps to avoid spectral leakage when shifting to Fourier space.</p><p>We find that the raw full-sky outputs from the network can reproduce the statistics of the S10 simulations overall quite well. However, we do find some small mismatches in the summary statistics between the network and the S10 simulations; for example, for the power spectra in the range l &#8712; &#240;2000; 8000&#222;, the agreement is better than 3%, 10%, 0.5%, 17%, and 0.3% for &#954;, kSZ, tSZ, CIB and radio respectively, however, it is not perfect. Therefore, we make a few corrections to the network simulations to match the S10 simulations more closely. Here, we describe the corrections we apply. First, to correct for the small mismatch in the power spectra, we apply one-dimensional transfer functions to the &#954;, kSZ, and tSZ maps. These transfer functions are computed as the square root of the ratio of the average of 10 network power spectra to the S10 power spectra. We compute the transfer functions at each 11 Around the poles of the sphere (i.e., the first and the last longitudinal rows of the grid), there is not enough physical area to sample a 1&#176;&#215; 1&#176;tile. Hence, we take the second and the secondto-the-last rows of the grid, mirror them longitudinally, and replace the first and the last rows of the grid with these mirrored rows. This ensures that we have continuous physical tiles around the poles at the cost of them not being unique. We find that this pole correction does not affect the overall statistics of the network simulations.</p><p>multipole, and apply to these transfer functions a onedimensional Gaussian filter with &#963; l &#188; 10 to smooth them out. We then convert these to isotropic two-dimensional transfer functions, and apply them to the spherical harmonics of the full-sky map.</p><p>We find larger deviations in the power spectrum between the network and the S10 simulations than specified above at larger (l &#8804; 2000) and smaller scales (l &#8805; 8000). The large scale deviation is due to the limited size of the sample patches as discussed in Sec. III. For the small scales, we find a roll-off in the power spectra starting at l &#188; 8000. We find that this roll-off starts at larger scales (l &#8804; 8000) if we train the network with lower resolution simulations (for example, 1 arcminute resolution), which indicates that the roll-off is related to the resolution of the initial training samples.</p><p>A second correction we apply is to adjust the CIB and radio maps as follows. We re-scale the CIB map by a factor of 1.1 to match the S10 power spectra for l &#8712; &#240;4000; 8000&#222;. We also re-scale the network CIB and radio source fluxes to match the rescaled S10 source counts. 14 After this re-scaling, we still find that the network overestimates the number counts of CIB sources with flux values greater than 1 mJy; thus we reduce the flux of those sources by replacing the original flux value, S, with S 0.63 . For radio sources, we find that replacing the original flux by S &#240;&#955;&#222; &#188; &#240;&#240;S &#254; 1&#222; &#955; -1&#222;=&#955; with &#955; &#188; 1.25 <ref type="bibr">[108]</ref> improves the match at the high-flux end.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>E. Generating lensed CMB and multifrequency maps</head><p>In order to generate lensed CMB (T, Q, U) maps, we first generate full sky unlensed CMB (T, Q, U) maps as Gaussian random fields on a CAR full-sky grid using the CAMB theory spectra used in S10. 15 Then, these unlensed CMB maps are lensed with a network full-sky &#954; map using the lensing method described in <ref type="bibr">[4]</ref>. As in <ref type="bibr">[4]</ref>, the lensing operation is performed at 1 arcminute resolution and agrees with the theory to better than few percent up to l &#188; 10;000.</p><p>Up to this point, all the training and corrections are done with the 148 GHz network simulations. Here, we discuss how we simulate the other frequency maps. We assume to leading order that the lensed CMB and kSZ perfectly follow a black-body spectrum (i.e., they do not vary with frequency in units of differential CMB temperature). The &#954; map is frequency independent. In order to simulate the tSZ map at different frequencies, we use the analytic calculations in <ref type="bibr">[109,</ref><ref type="bibr">110]</ref> to compute the frequency dependent scaling factor, a&#240;&#957;&#222;, and scale the 148 GHz tSZ map following M tSZ &#240;&#957;&#222; &#188; a&#240;&#957;&#222;=a&#240;148&#222; &#195; M tSZ &#240;148 GHz&#222;, where M tSZ is the real-space tSZ map. For CIB and radio sources, we find the mean spectral indices between each frequency and the reference frequency of 148 GHz, directly from the S10 catalogues; this results in the spectral indices shown in Table <ref type="table">III</ref> of Appendix C. For each source in the 148 GHz map, we then randomly sample a spectral index from a Gaussian distribution with the mean and the standard deviation given in Table <ref type="table">III</ref>, and scale its flux accordingly. In this way, we generate full-sky maps of the combined lensed CMB, kSZ, tSZ, CIB, and radio signals at 30, 90, 148, 219, 277, and 350 GHz.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>IV. RESULTS</head><p>In this section, we study the statistical properties of the mmDL simulations generated by our network. Unless otherwise noted, all statistics are computed using fullsky maps after applying a flux-cut of 7 mJy at 148 GHz to radio and CIB maps, and appling the corrections discussed in Sec. III D. We first visually compare the full-sky mmDL and S10 simulations in Fig. <ref type="figure">5</ref>. Here we show the full-sky maps in the Mollweide projection, as well as zoom-ins of 1&#176;&#215; 1&#176;patches. Visually, the mmDL simulations and the S10 simulations are indistinguishable.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>A. Pixel-level Summary Statistics</head><p>There are a number of pixel-level summary statistics used in the literature. Such examples are (1) Minkowski functionals <ref type="bibr">[111]</ref>, (2) one-point probability distributions, and (3) source counts. For two dimensional images, Minkowski functionals measure the area (F), the contour length (U), and the dimensionless curvature known as the Euler characteristic (&#967;) as a function of varying pixel threshold value. Combined together these three functionals give an estimate of the topology of an image, which is sensitive to the presence of non-Gaussianity. We compute Minkowski functionals using the minkfncts2d software, which is publicly available at <ref type="bibr">[112]</ref>. Figure <ref type="figure">6</ref> shows as solid curves the functionals computed using the average of 100 1&#176;&#215; 1&#176;tiles output by the VAEGAN described in Sec. III C. 16  The dashed curves are calculated using the full-sky S10 simulation described in Sec. II. Here, we compute the functionals from the network without the corrections discussed in Sec. III D. Hence, the Minkowski functionals shown in Fig. <ref type="figure">6</ref> give an estimate of how well the network performs before applying any corrections. Overall, we find very good agreement between the functionals computed from the network and the S10 simulations. The only noticeable mismatch is in the U and &#967; functionals of the radio sources, which indicates a mismatch in the real-space shape of radio point sources between the mmDL and S10 14 Note that the original S10 CIB source fluxes have been rescaled by a factor of 0.75 as discussed in Sec. II A. <ref type="bibr">15</ref> The CAMB theory spectra used in this work can be found under the resources directory at <ref type="bibr">[82]</ref>. <ref type="bibr">16</ref> We recomputed the Minkowski functionals on a 20 degree wide band around the celestial equator after making the corrections described in Sec. III D; we did not find any significant change, except a slight shift of the CIB curves as compared to Fig. <ref type="figure">6</ref>. simulations. The S10 point sources are "true" point sources by construction (i.e., each source falls into a single pixel).</p><p>On the other hand, the network point sources are constructed as the summation of multiple convolution kernels, hence they can potentially extend beyond a single pixel. In practice, the simulations will be convolved with a beam with a full width at half maximum (FWHM) larger than 0.5 arcminute. So this minor mismatch in the radio source shape will have a negligible effect in actual analyses. Another pixel-level summary statistic we consider is the one-point probability distribution function (one-point PDF) shown in Fig. <ref type="figure">7</ref>; this one-point PDF is the histogram of pixel values. Before computing this histogram, we divide the pixels in each component map by the standard deviation of pixel values in that map in order to have unit variance. One-point PDFs have been studied previously in the context of CMB weak lensing and tSZ analyses (e.g., <ref type="bibr">[80,</ref><ref type="bibr">113,</ref><ref type="bibr">114]</ref>), and have been shown to be good probes of non-Gaussian information. We find good overall agreement between a random realization of a full-sky network simulation and the S10 simulations.</p><p>The last pixel-level statistics we consider is the source number counts. In Fig. <ref type="figure">8</ref>, we show the histogram of the source number counts per square degree per flux bin for the simulated CIB and radio maps. As discussed in Sec. III D, the network overestimates the number of CIB sources with flux levels greater than 1 mJy, and we correct for this by scaling down the network flux levels at the high flux tail. This scaling substantially improves the overall match. This scaling has negligible impact on the other CIB statistics discussed below, since the other statistics are largely driven by lower flux sources.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>B. Two-point statistics</head><p>Next, we show the two-point statistics of the simulations in Figs. <ref type="figure">9</ref> and<ref type="figure">10</ref>. Since we apply one-dimensional transfer functions and scale factors, computed by comparing the network power spectra to the S10 power spectra (see Sec. III D for details), the power spectra of the network and S10 match by construction, as shown in Fig. <ref type="figure">9</ref>. Figure <ref type="figure">10</ref> shows the cross spectra between the &#954; map and the extragalactic foreground components at 148 GHz. Overall, we find a good match between the two sets of cross spectra. We find only a small extra correlation between &#954; and tSZ at small scales (l &#8805; 8000). We also check the cross correlation among the other components (for instance the FIG. <ref type="figure">7</ref>. Shown are one-point probability distribution functions of the extragalatic foregrounds at 148 GHz. Solid curves are calculated from a random sample of a full-sky simulation from the network, and dashed curves are calculated using the full-sky S10 simulation. A flux-cut of 7 mJy is applied to both CIB maps. Each map is divided by the standard deviation of its pixel values in order to have unit variance. We find good agreement between the network curves and the S10 curves. FIG. <ref type="figure">6</ref>. Shown are the Minkowski functionals of the extragalactic foreground components at 148 GHz. The solid curves are calculated using the average of 100 1&#176;&#215; 1&#176;tiles output by the VAEGAN described in Sec. III C. The dashed curves are calculated using the full-sky S10 simulation described in Sec. II. Both the S10 and the network simulations are normalized following the procedure detailed in Sec. II C. To compute the Minkowski functionals, a binary map is first constructed with a value of one above a certain pixel threshold, and zero otherwise. Then, the this binary map is used to compute the area above the threshold (F), its boundary (U), and the dimensionless curvature known as the Euler characteristic (&#967;). These three functionals, give an estimate of the non-Gaussianity of each component <ref type="bibr">[111]</ref>. We find that the network can reproduce well the Minkowski functionals calculated using the S10 simulations. This indicates that the network learned the non-Gaussian information in S10. tSZ and CIB), and similarly find good matches. Note that we do not apply any correction to the network cross spectra. The matches between the network and the S10 cross spectra indicate that the network has correctly learned the correlations among the foreground components.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>C. Three-point and four-point functions</head><p>We also compute higher order statistics, in particular the three-point and four-point functions. We compute the bispectra of foregrounds following <ref type="bibr">[88,</ref><ref type="bibr">115,</ref><ref type="bibr">116]</ref> using the PiInTheSky software. 17 The binned bispectra of the simulations are shown in Fig. <ref type="figure">11</ref> and Fig. <ref type="figure">12</ref>. One advantage of the binned bispectrum method is that it requires no explicit modeling of the signal. For visualization purposes, we plot the absolute value of the kSZ bispectra, and we plot the tSZ bispectra multiplied by a factor of -1. Overall we find a good match in the shape and amplitude of the bispectra, even though our training procedure was not explicitly optimized to reproduce the bispectra. With minor modifications to the training procedure, we expect this match can be further improved.</p><p>In Fig. <ref type="figure">12</ref>, we show a squeezed configuration bispectra, where one leg of the triangle is l 1 &#188; 35, and the other two legs have the same length (l 2 &#188; l 3 ). As discussed in Sec. III D, we generate the full-sky realizations by "stitching" up 1&#176;&#215; 1&#176;tiles. Naively, the network simulations are not expected to reproduce the statistics for modes larger than the tile size (i.e., roughly l &#8804; 200). However, we find that the network correctly reproduces the correlations between the super tile modes (l 1 &#188; 35) and the smaller scale modes (l &#8805; 200). This indicates that our overall procedure can generate faithful full-sky realizations, which contain the correct information at all scales.</p><p>Figures <ref type="figure">13</ref> and<ref type="figure">14</ref> shows the comparison for the fourpoint functions used to reconstruct the lensing potential. To do this comparison, we first generate an unlensed CMB realization using the WMAP5 cosmology <ref type="bibr">[83]</ref>; we then make two lensed versions of this CMB map, one lensed by the network &#954; and another lensed by the S10 &#954; map. Since our lensing reconstruction filter requires some instrument noise and a finite resolution, we add to each simulation a white noise level of 10 &#956;K-arcminute and a 1.3 arcminute Gaussian beam, which matches current ground-based CMB experiment sensitivity. We reconstruct the lensing potential using the temperature-only quadratic estimator <ref type="bibr">[117]</ref> in order to focus on the bias induced from extragalactic foregrounds. We include CMB multipoles in the range of l &#8712; &#189;100; 3000 for the reconstruction. Figure <ref type="figure">13</ref> shows the cross spectra between the reconstructed lensing convergence and the input lensing convergence from both the network and S10 simulations, in the absence of other foreground contamination. FIG. <ref type="figure">8</ref>. Shown is a histogram of the source number counts per square degree per flux bin for CIB and radio maps. The solid curves are generated using a random simulation from the network, while the dashed curves are generated using the S10 simulation. A flux cut of 7 mJy is applied to both CIB and radio maps for both network and S10 simulations. We find good overall agreement. FIG. 9. Shown are the power spectra of simulations at 148 GHz. The solid curves are calculated from a random sample of a fullsky simulation from the network, and dashed curves are calculated using the full-sky S10 simulation. A flux-cut of 7 mJy is applied to both CIB and radio maps. For the purpose of visualization, we multiply the &#954; map by a factor of 100 before taking the power spectrum. Since we apply one-dimensional transfer functions and scale factors, computed by comparing the network power spectra to the S10 power spectra (see Sec. III D for details), the power spectra of the network and S10 match by construction. <ref type="url">https://github.com/simonsobs/PiInTheSky</ref>. </p><p>p , where l 1 , l 2 , and l 3 form a triangle. FIG. 12. Similar to Fig. <ref type="figure">11</ref>, but for a squeezed configuration, where one leg is l 1 &#188; 35, and the other two legs are the same length (l 2 &#188; l 3 &#222;. We find that the network can correctly reproduce the correlations between modes larger than the tile size (i.e., 1&#176;&#215; 1&#176;or roughly l &#8804; 200 in the harmonic domain) and modes within the tiles (i.e., roughly l &#8805; 200). FIG. <ref type="figure">13</ref>. Shown are the reconstructed lensing auto spectra. The red solid curve is generated from a CMB map lensed with a fullsky &#954; map from the network. The blue dashed curve is generated using the same CMB map, instead lensed with the full-sky S10 &#954;. No foregrounds are added. Lensing reconstruction is done using the temperature-only quadratic estimator, including multipoles of l &#8712; &#189;100; 3000. We compute the lensing auto spectrum as the cross spectra of the reconstructed kappa map and the input kappa map in order to avoid reconstruction noise bias. FIG. <ref type="figure">10</ref>. Shown via cross correlation coefficients are the cross spectra between the &#954; map and the extragalactic foreground components at 148 GHz. The solid curves are generated with a full-sky map from our network, while the dashed curves are generated from the S10 simulations. A flux-cut of 7 mJy is applied to both the CIB and radio maps. There is a good overall match between the curves. Note that we do not apply any correction to the network cross spectra; the matches between the network and the S10 cross spectra indicate that the network has correctly learned the correlations among the foreground components.</p><p>We find a good match for all the scales considered. Fig. <ref type="figure">14</ref> shows the contamination of the reconstructed lensing convergence from simulated lensed CMB maps plus the extragalactic foregrounds as a percent bias (i.e., C &#954;&#954; L;biased =C &#954;&#954; L;unbiased &#215; 100, where C &#954;&#954; L is computed from the cross spectra between the reconstructed and the input lensing convergences as described above). We find good agreement between the biases computed from the network and those from the S10 simulations.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>V. FINAL NETWORK PRODUCT</head><p>We make 500 mmDL realizations in total using our network, and release them publicly on the Legacy Archive for Microwave Background Data Analysis (LAMDA) <ref type="foot">18</ref> and the National Energy Research Scientific Computing Center (NERSC) cluster. <ref type="foot">19</ref> These are full-sky simulations at half-arcminute resolution at six different frequencies <ref type="bibr">(30,</ref><ref type="bibr">90,</ref><ref type="bibr">148,</ref><ref type="bibr">219,</ref><ref type="bibr">277</ref>, and 350 GHz), which include:</p><p>(i) the lensing convergence map (&#954;), (ii) the kinetic Sunyaev-Zel'dovich effect (kSZ), (iii) the thermal Sunyaev-Zel'dovich effect (tSZ), (iv) the cosmic infrared background (CIB), and (v) the radio galaxies (radio).</p><p>For each realization, we generate six maps of the frequency-dependent components (tSZ, CIB, and radio), and one map of the frequency-independent components (lensed CMB (T, Q, U), &#954;, and kSZ). We release all of these components separately, as well as a combined final microwave sky map in temperature at each of the six frequencies. In total, each realization contains 29 (6 &#215; 3 &#254; 5 &#254; 6) full sky maps. The simulations are natively made in the CAR pixelization and converted to HEALPix by reprojecting the CAR maps to spherical harmonic a lm up to an l max of 10,000 for &#954;, kSZ, and tSZ maps, and an l max of 25,000 for CIB and radio maps; note that we chose a higher l max of 25,000 for CIB and radio maps to reduce the effect of spectral leakage around the sources and to reproduce the source number counts shown in Fig. <ref type="figure">8</ref>. These a lm are then reprojected onto full-sky HEALPix maps of Nside &#188; 8192. We release this set of simulations in both HEALPix and CAR pixel formats, however, for space reasons we provide 500 HEALPix realizations and only 30 CAR realizations. We also provide scripts to convert between HEALPix and CAR maps. Each HEALPix fits file is 3.2 GB for double-precision, and each CAR file is 3.6 GB for single-precision. Thus the full package is 50 TB, for 500&#215;29&#215;3.2GB&#254;30&#215;29&#215;3.6GB. We also release the code used in this work at <ref type="bibr">[82]</ref>.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>VI. DISCUSSION</head><p>We have presented for the first time high-resolution fullsky DL simulations at millimeter wavelengths that include correlated foreground components. We find that these mmDL simulations can reproduce not only the power spectra of the original simulations, but also can naturally reproduce the other non-Gaussian statistics considered in this work (i.e., one-point PDFs, cross-spectra, bispectra, lensing reconstructions, and lensing reconstruction biases) with good overall agreement. This is notable since we only amend the mmDL simulations to reproduce the power spectra and the source number counts above 1 mJy.</p><p>The procedure we developed can be used to generate an unlimited number of full-sky realizations starting from just a single realization of a full-sky simulation. Ordinarily there would not be enough independent small tiles from a single full-sky simulation to train a network to predict new foreground maps given a kappa map. However, in this work we achieve this by first generating an augmented dataset (intermediate product 2 in Fig. <ref type="figure">1</ref>) by training our network on the original simulations. This augmented dataset is more than four times larger than the original one and each patch is statistically independent; thus it can be used to train the next network step (training step 2 in Fig. <ref type="figure">1</ref>) that requires a larger amount of training data. This enables the capability to mass produce independent full-sky realizations from a single expensive full-sky simulation. FIG. <ref type="figure">14</ref>. Shown is the percent bias to the reconstructed lensing auto spectrum induced by extragalactic foregrounds at 148 GHz. The solid curves are calculated with a random full-sky simulation from the network, while the dashed curves are computed using the S10 simulation. Lensed CMB maps are made as discussed in Fig. <ref type="figure">13</ref>. A flux-cut of 7 mJy is applied to both CIB and radio maps. The lensing auto spectra are computed as the cross spectra of the reconstructed and input kappa maps as in Fig. <ref type="figure">13</ref>. We find good agreement between the S10 simulation and the network.</p><p>Currently, DL training is mostly done with small tiles due to limited computing resources (both memory and GPU). Though these resource issues will be alleviated as hardware improves overtime, we expect that they will persist for the foreseeable future. Unfortunately, these small DL simulations have a limited use when analyzing current and future wide-field CMB survey data. In this work, we outline a procedure for generating many realizations of full-sky maps, stitching together many individual tiles, that can faithfully recover the high-order statistics of a full-sky map without discontinuities or repeated features.</p><p>An advantageous feature of our network is that the input is a full-sky kappa map (top green box in Fig. <ref type="figure">1</ref>). Thus one can now in principle take a full-sky kappa map from any large-scale structure (LSS) simulation and generate the corresponding lensed CMB and correlated foreground components at millimeter wavelengths. This is especially useful in the current era of combining results from both CMB and LSS surveys, which require a common set of simulations. One can, for example, input in a full-sky kappa map taken from a simulation developed for the Rubin or Roman surveys <ref type="bibr">[118,</ref><ref type="bibr">119]</ref>, and generate the corresponding CMB maps, resulting in simulations with both galaxies and CMB secondary components. <ref type="foot">20</ref>We envision these mmDL simulations useful for all parts of CMB data analyses, such as verification of pipelines, generation of covariance matrices, and analyses of foreground biases. Furthermore, since our procedure is numerically efficient, especially for generating foreground realizations on a small patch of the sky, we can use our DL method as a part of a forward modeling pipeline (such as discussed in <ref type="bibr">[120]</ref>) where one varies the initial conditions to match observations. Before we conclude, we briefly comment on the potential origin of the corrections we make in Sec. III D. The properties of generative DL models, in particularly those of GAN, are active areas of research (see <ref type="bibr">[121]</ref> for more discussion), which is out of the scope of this work. However, we discuss a couple considerations relevant to the applications of generative DL models in physics. First, there is no simple way to impose physical constraints (for instance, symmetry requirements) to neural networks, though there are studies in this direction (for example <ref type="bibr">[122,</ref><ref type="bibr">123]</ref>). This prevents DL practitioners from leveraging some physical insights important to the traditional modeling of physical processes. Second, even though the Wasserstein distance used throughout this work is the most general way to compute the distance between two distributions (i.e., the most general discriminator), we can only compute an approximated form of the Wasserstein metric due to numerical reasons. It is not intuitively clear whether optimizing this approximated version should always lead to physical results. These limitations are unlikely fundamental short comings of generative DL models, and we expect that they will be eventually overcome.</p><p>We also acknowledge that additional external independent datasets, similar to S10, would be useful for the further validation of the method presented in this work, in particular to assess both the statistical and systematic error inherent to the method. This would also potentially allow us to tune network parameters to match high-order statistics with greater precision. Given the expense of generating such simulations via traditional methods, it is not clear when many such datasets will become available.</p><p>Finally, we note that our network is trained to the specific cosmology and baryonic model used to generate the S10 simulations. In principle, a GAN network should be able to generate simulations at different cosmologies and with different gas physics by extrapolating the latent space variables (see <ref type="bibr">[79]</ref> for discussion). This is potentially a very powerful technique that can vastly expand the applicability of these mmDL simulations.   <ref type="bibr">[124]</ref> (which includes a log scaling), clipping, min-max, and the standard score. We tried a number of different normalization methods, and found that the combination of log scaling (adopted from <ref type="bibr">[74]</ref>), and the standard score yielded the best results in our case. In Table <ref type="table">II</ref>, we list the parameter values used in our normalization procedure. These parameter values are derived from the validation dataset described in Sec. II B. Each of these parameters are described in detail in Sec. II C.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>APPENDIX B: GRID SCHEMATIC</head><p>Since our network can only process relatively small tiles, we need a systemic way to divide a full-sky map into a grid of tiles. For numerical reasons, the natural choice of tile width and height is 2 n pixels. In this work, we use the tile size of 128 &#215; 128 pixels, which is roughly 1&#176;&#215; 1&#176;. The schematic of our tile grid is shown in Fig. <ref type="figure">15</ref>. Note that we include 20 pixels overlap between tiles, which ensures continuity when we reproject tiles on to a full-sky map. This grid procedure results in a grid of tiles with 200 tiles along a longitudinal direction and 400 tiles along a latitude direction.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>APPENDIX C: FREQUENCY DEPENDENCE OF CIB AND RADIO SOURCES</head><p>As discussed in Sec. III D, we estimate the frequency dependence of CIB and radio sources using the S10 catalogues. For each source in the catalogues, we compute its spectral index between a given frequency and the reference frequency of 148 GHz by comparing the flux of that source at the given frequency <ref type="bibr">(30,</ref><ref type="bibr">90,</ref><ref type="bibr">219,</ref><ref type="bibr">277,</ref><ref type="bibr">and 350 GHz)</ref> to the flux at the reference frequency. In Table <ref type="table">III</ref>, we show the means and standard deviations FIG. <ref type="figure">15</ref>. We show a schematic of the tiling grid described in Sec. III D. Each tile is 128 &#215; 128 pixels (roughly 1&#176;&#215; 1&#176;) in the CAR pixellization and corresponds to a patch effectively centered at the celestial equator. We cutout each tile with a 20-pixel overlap region around the edges to ensure that the final maps are continuous when we reproject the tiles back on to a full-sky CAR map. 16. We show the power spectra of CIB maps at different frequencies. The solid curves are calculated from a random realization of a full-sky simulation from the network, and dashed curves are calculated using the full-sky S10 simulation. A fluxcut of 7 mJy at 148 GHz is applied to all CIB maps. For each source in the 148 GHz map, we simulate its frequency dependence as described in Sec. III D and Appendix C. We find good agreement for the CIB power spectra between the S10 simulation and the network.</p><p>of the spectral indices for CIB and radio sources. Note that we only consider the sources that meet our flux-cut criteria (&#8804;7 mJy at 148 GHz) in this estimation.</p><p>For each source in the network 148 GHz map, we randomly assign it a spectral index for each frequency, with each index drawn from a Gaussian distribution with a mean and the standard deviation as specified in Table <ref type="table">III</ref>; we then scale the source's 148 GHz flux accordingly and place it in the new frequency map. We find that we can recover well the frequency dependence of the original S10 CIB and radio maps using this method as shown in Figs. <ref type="figure">16</ref> and<ref type="figure">17</ref>.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>APPENDIX D: REALIZATION DEPENDENT SCATTER</head><p>One common failure mode of GANs is mode collapse, which is when a GAN repeatedly generates the same or statistically similar images. In the context of our work, mode collapse will lead to a lower variance of the simulations than expected, due to the presence of repeated tiles. In this section, we empirically show that the variances of our network simulations match the expected variances. Figure <ref type="figure">18</ref> shows the diagonal elements of the covariance matrix derived from the &#954; power spectrum of 20 network simulations. Here, the expected variance is given by Eq. ( <ref type="formula">4</ref>) in <ref type="bibr">[125]</ref>; in the absence of experimental noise, this equation gives the expected variance of an approximately Gaussian random field. Similarly, we show the estimated variance of 20 network kSZ and CIB maps in 19 and 20. For each of these components, we find that the variance from the network simulations matches the expected variance.</p><p>Since each lensed CMB realization is generated from independent unlensed CMB realizations, the lensed CMB maps should have the correct variance by the construction.</p><p>FIG. 17. The same as Fig. <ref type="figure">16</ref> above, but for radio maps instead of CIB maps. FIG. <ref type="figure">18</ref>. We show the diagonal elements of the covariance matrix derived from the &#954; power spectrum. The blue curves are estimated from 20 realizations of a full-sky simulation from the network, and the dashed curve is calculated using Eq. ( <ref type="formula">4</ref>) in <ref type="bibr">[125]</ref> given the S10 &#954; power spectrum. We find good agreement between the variance from the network simulations and the expected variance. FIG. <ref type="figure">19</ref>. The same as Fig. <ref type="figure">18</ref> above, but for kSZ maps instead of &#954; maps. FIG. <ref type="figure">20</ref>. The same as Fig. <ref type="figure">18</ref> above, but for CIB maps at 148 GHz instead of &#954; maps. Note that a flux-cut of 7 mJy at 148 GHz is applied to the CIB maps. </p></div><note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="4" xml:id="foot_0"><p>https://github.com/simonsobs/pixell.</p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="5" xml:id="foot_1"><p>https://github.com/Libsharp/libsharp.</p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" xml:id="foot_2"><p>123521-3</p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="6" xml:id="foot_3"><p>Another popular approach is to scale an image such that all the pixel values lie between -1 and 1. During our network training, we found that using the standard score method leads to more stable training compared to this rescaling.</p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="7" xml:id="foot_4"><p>Note that we distinguish v and v 0 here because the pixel values of the tSZ, CIB, and radio maps are first scaled by Equation (1) (i.e., p 0 &#188; f&#240;p&#222;), whereas p 0 &#188; p for the &#954; and kSZ maps.</p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="8" xml:id="foot_5"><p>We still use the test and the validation datasets from our primary input data to fine-tune the network parameters and to validate the network outputs.</p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="9" xml:id="foot_6"><p>Note that each epoch here has fours times more samples than the epochs in Sec. III A.</p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="10" xml:id="foot_7"><p>Note that the next network (training step 3) can rescale each foreground component by a constant factor as described in Sec. III C.</p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="12" xml:id="foot_8"><p>We tried both linear interpolation and popular cubic spline methods, and found no noticeable difference in the resulting summary statistics. Thus, we chose to use the linear interpolation method which is more computationally efficient.</p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="13" xml:id="foot_9"><p>We set the pixel values at the outermost edges of the apodization mask to the values of pixels one pixel away inside the map to avoid losing information.</p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="18" xml:id="foot_10"><p>https://lambda.gsfc.nasa.gov/simulation/tb_sim_ov.cfm.</p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="19" xml:id="foot_11"><p>https://crd.lbl.gov/departments/computational-science/c3/c3research/cosmic-microwave-background/cmb-data-analysis-atnersc/.</p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="20" xml:id="foot_12"><p>If the given LSS kappa map includes non-Gaussian structure, we would just remove training step 3 from our network.</p></note>
		</body>
		</text>
</TEI>
