GATSBI: G ENERATIVE A DVERSARIAL T RAINING FOR S IMULATION -B ASED I NFERENCE
Anonymous authors
Paper under double-blind review
A BSTRACT
Simulation-based inference (SBI) refers to statistical inference on stochastic models for which we can generate samples, but not compute likelihoods.
Like SBI algorithms, generative adversarial networks (GANs) do not require explicit likelihoods
We study the relationship between SBI and GANs, and introduce GATSBI, an adversarial approach to SBI.
GATSBI reformulates the variational objective in an adversarial setting to learn implicit posterior distributions.
Inference with GATSBI is amortised across observations, works in high-dimensional posterior spaces and supports implicit priors.
We evaluate GATSBI on two SBI benchmark problems and on two high-dimensional simulators.
On a model for wave propagation on the surface of a shallow water body, we show that GATSBI can return well-calibrated posterior estimates even in high dimensions.
On a model of camera optics, it infers a high-dimensional posterior given an implicit prior, and performs better than a state-of-the-art SBI approach.
We also show how GATSBI can be extended to perform sequential posterior estimation to focus on individual observations.
Overall, GATSBI opens up opportunities for leveraging advances in GANs to perform
Bayesian inference on high-dimensional simulation-based models
I NTRODUCTION
Hypothesis-making in many scientiﬁc disciplines relies on stochastic simulators that—unlike expressive statistical models such as neural networks—have domain-relevant, interpretable parameters.
Finding the parameters θ of a simulator that reproduce the observed data x o constitutes an inverse problem.
In order to use these simulators to formulate further hypotheses and experiments, one needs to obtain uncertainty estimates for the parameters and allow for multi-valuedness, i.e., different candidate parameters accounting for the same observation.
These requirements are met by Bayesian inference, which attempts to approximate the posterior distribution p ( θ | x o ) .
While a variety of techniques exist to calculate posteriors for scientiﬁc simulators which allow explicit likelihood calculations p ( x | θ ) , inference on black-box simulators with intractable likelihoods a.k.a.
‘simulation-based inference’ (Cranmer et al., 2020), poses substantial challenges.
In traditional, so-called Approximate
Bayesian Computation (ABC) approaches to SBI (Beaumont et al., 2002, 2009; Marjoram et al., 2003;
Sisson et al., 2007), one samples parameters θ from a prior π ( θ ) and accepts only those parameters for which the simulation output x ∼ p ( x | θ ) is close to the observation d ( x, x o ) < (cid:15) .
With increasing data dimensionality N , this approach incurs an exponentially growing simulation expense (‘curse of dimensionality’); it also requires suitable choices of distance function d and acceptance threshold (cid:15) .
Recent SBI algorithms (e.g., Greenberg et al., 2019; Gutmann and Corander, 2015; Hermans et al., 2020; Lueckmann et al., 2017; Meeds and Welling, 2014; Papamakarios and Murray, 2016; Radev et al., 2020; Thomas et al., 2021) draw on advances in machine learning and are often based on
Gaussian Processes (Rasmussen and Williams, 2006) or neural networks for density estimation (e.g. using normalizing ﬂows; Papamakarios et al., 2021).
While this has led to substantial improvements over classical approaches, and numerous applications in ﬁelds such as cosmology (Cole et al., 2021), neuroscience (Gonçalves et al., 2020) or robotics (Muratore et al., 2021), statistical inference for high-dimensional parameter spaces is an open challenge (Cranmer et al., 2020; Lueckmann et al., 2021):
This prevents the application of these methods to many real-world scientiﬁc simulators.
In machine learning, generative adversarial networks (GANs, Goodfellow et al., 2014) have emerged as powerful tools for learning generative models of high-dimensional data, for instance, images (Isola et al., 2016;
Radford et al., 2015; Zhu et al., 2017).
Using a minimax game between a ‘generator’ and a ‘discriminator’, GANs can generate samples which look uncannily similar to the data they have been trained on.
Like SBI algorithms, adversarial training is ‘likelihood-free’, i.e., it does not require explicit evaluation of a density function, and also relies on comparing empirical and simulated data.
This raises the question of whether GANs and SBI solve the same problem, and in particular whether and how adversarial training can help scale SBI to high-dimensional regimes.
Here, we address these questions and make the following contributions: First, we show how one can use adversarial training to learn an implicit posterior density for SBI.
We refer to this approach as GATSBI (Generative Adversarial Training for SBI) 1 .
Second, we show that GATSBI can be formulated as an adversarial variational inference algorithm (Huszár, 2017; Makhzani et al., 2015;
Mescheder et al., 2017), thus opening up a potential area of exploration for SBI approaches.
Third, we show how it can be extended to reﬁne posterior estimates for speciﬁc observations, i.e., sequential posterior estimation.
Fourth, on two low-dimensional SBI benchmark problems, we show that
GATSBI’s performance is comparable to common SBI algorithms.
Fifth, we illustrate GATSBI on high-dimensional inference problems which are out of reach for most SBI methods:
In a ﬂuid dynamics problem from earth science, we learn an implicit posterior over 100 parameters.
Furthermore, we show that GATSBI (in contrast to most SBI algorithms) can be used on problems in which the prior is only speciﬁed implicitly: by recasting image-denoising as an SBI problem, we learn a posterior over (784-dimensional) images.
Finally, we discuss the opportunities and limitations of GATSBI relative to current SBI algorithms, and chart out avenues for future work.
M ETHODS 2. S IMULATION - BASED INFERENCE AND ADVERSARIAL NETWORKS
Simulation-based inference (SBI) targets stochastic simulators with parameters θ that we can use to generate samples x .
In many scientiﬁc applications, simulators are ‘black-box’: we cannot evaluate the likelihood p ( x | θ ) , take derivatives through the simulator, or access its internal random numbers.
The goal of SBI is to infer the parameters θ , given empirically observed data x o i.e., to obtain the posterior distribution p ( θ | x o ) .
In most applications of existing SBI algorithms, the simulator is a mechanistic forward model depending on a low ( ∼ 10 ) number of parameters θ .
Generative adversarial networks (GANs) (Goodfellow et al., 2014) consist of two networks trained adversarially.
The generator f φ ( z ) produces samples x from latent variables z ; the discriminator
D ψ acts as a similarity measure between the distribution of generated x and observations x o from a distribution p data ( x o ) .
The two networks are pitted against each other: the generator attempts to produce samples that would fool the discriminator; the discriminator is trained to tell apart generated and ground-truth samples.
This takes the form of a minimax game min φ max ψ L ( φ, ψ ) between the networks, with cross-entropy as the value function:
[Equation]
At the end of training, if the networks are sufﬁciently expressive, samples from f φ are hard to distinguish from the ground-truth samples, and the generator approximates the observed data distribution p data ( x o ) .
GANs can also be used to perform (implicit) conditional density estimation, by making the generator and discriminator conditional on external covariates t (Mirza and Osindero, 2014).
Note that the GAN formulation does not evaluate the intractable distribution p data ( x o ) or p data ( x o | t ) at any point.
Thus, GANs and SBI appear to be solving similar problems: They are both ‘likelihood-free‘ i.e., they do not evaluate the target distribution, but rather exclusively work with samples from it.
Nevertheless, GANs and SBI differ in multiple ways: GANs use neural networks, and thus are always differentiable, whereas the numerical simulators in SBI may not be.
Furthermore, the latent variables for the GAN generator are typically accessible, while in SBI, one may not have access to the simulator’s internal random variables.
Finally, in GANs, the goal is to match the distribution of the generated samples x to that of the observed data x o , and parameters of the generator are learnt as point estimates.
In contrast, the goal of SBI is to learn a distribution over parameters θ of a simulator consistent with both the observed data x o and prior knowledge about the parameters.
However, conditional GANs can be used to perform conditional density estimation.
How can we repurpose them for SBI?
We propose an approach using adversarial training for SBI, by employing GANs as implicit density estimators rather than generative models of data.
2. G ENERATIVE A DVERSARIAL T RAINING FOR SBI: GATSBI
Our approach leverages conditional GANs for SBI.
We train a deep generative neural network f φ with parameters φ , i.e., f takes as inputs observations x and noise z from a ﬁxed source with distribution p ( z ) , so that f φ ( x, z ) deterministically transforms z to generate θ .
This generative network f is an implicit approximation q
φ ( θ | x ) of the posterior distribution, i.e.,
[Equation]
We train f adversarially:
We sample many parameters θ from the prior, and for each θ , simulate x ∼ p ( x | θ ) i.e., we sample tuples ( θ, x ) ∼ π ( θ ) p ( x | θ )
=
p ( θ | x ) p ( x ) .
These samples from the joint constitute our training data.
We deﬁne a discriminator D , parameterised by ψ , to differentiate between samples θ drawn from the approximate posterior q φ ( θ | x ) and the true posterior p ( θ | x ) .
The discriminator is conditioned on x .
We calculate the cross-entropy of the discriminator outputs, and maximize it with respect to the discriminator parameters ψ and minimize it with respect to the generator parameters φ i.e., min φ max ψ L ( φ, ψ ) , with
[Equation]
This conditional GAN value function targets the desired posterior p ( θ | x ) :
Proposition 1.
Given a ﬁxed generator f φ , the discriminator D ψ ∗ maximizing equation 2 satisﬁes
[Equation]
and the corresponding loss function for the generator parameters is the Jensen-Shannon divergence (JSD) between the true and approximate posterior,
[Equation]
Using sufﬁciently ﬂexible networks, the GATSBI generator trained with the cross-entropy loss converges in the limit of inﬁnitely many samples to the true posterior, since the JSD is minimised if and only if q φ ( θ | x ) = p ( θ | x ) .
The proof directly follows Proposition 1 and 2 from Goodfellow et al.
and is given in detail in App. A.1.
GATSBI thus performs amortised inference , i.e., learns a single inference network which can be used to perform inference rapidly and efﬁciently for a wide range of potential observations, without having to re-train the network for each new observation.
The training steps for GATSBI are described in App.
B.
2. R ELATING GATSBI TO EXISTING SBI APPROACHES
There have been previous attempts at using GANs to ﬁt black-box scientiﬁc simulators to empirical data.
However, unlike GATSBI, these approaches do not perform Bayesian inference: Kim et al.
(2020) and Louppe et al.
(2017) train a discriminator to differentiate between samples from the blackbox simulator and empirical observations.
They use the discriminator to adjust a proposal distribution for simulator parameters until the resulting simulated data and empirical data match.
However, neither approach returns a posterior distribution representing the balance between a prior distribution and a ﬁt to empirical data.
Similarly, Jethava and Dubhashi (2017) use two generator networks, one to approximate the prior and one to learn summary statistics, as well as two discriminators.
This scheme yields a generator for parameters leading to realistic simulations, but does not return a posterior over parameters.
Parikh et al.
(2020) train a conditional GAN (c-GAN), as well as two additional
GANs (r-GAN and t-GAN) within an active learning scheme, in order to solve ‘population of models’ problems (Britton et al., 2013; Lawson et al., 2018).
While c-GAN exhibits similarities with GATSBI, the method does not do Bayesian inference, but rather solves a constrained optimization problem.
Adler and Öktem (2018) use Wasserstein-GANs (Arjovsky et al., 2017) to solve Bayesian inverse problems in medical imaging.
While their set-up similar to GATSBI, the Wasserstein metric imposes stronger conditions for the generator to converge to the true posterior (App.
Sec. A.3). Several SBI approaches train discriminators to circumvent evaluation of the intractable likelihood (e.g., Cranmer et al., 2015; Gutmann et al., 2018; Pham et al., 2014; Thomas et al., 2021).
Hermans et al.
(2020) train density-ratio estimators by discriminating samples ( θ, x ) ∼ π ( θ ) p ( x | θ ) from ( θ, x ) ∼ π ( θ ) p ( x ) , which can be used to sample from the posterior.
Unlike GATSBI, this requires a potentially expensive step of MCMC sampling.
A closely related approach (Durkan et al., 2020; Greenberg et al., 2019) directly targets the posterior, but requires a density estimator that can be evaluated—unlike GATSBI, where the only restriction on the generator is that it remains differentiable.
Finally, ABC and synthetic likelihood methods have been developed to tackle problems in highdimensional parameter spaces ( > 100-dimensions) although these require model assumptions regarding the Gaussianity of the likelihood (Ong et al., 2018), or low-dimensional summary statistics (Kousathanas et al., 2015;
Rodrigues et al., 2019), in addition to MCMC sampling.
2. R ELATION TO ADVERSARIAL INFERENCE
GATSBI reveals a direct connection between SBI and adversarial variational inference.
Density estimation approaches for SBI usually use the forward Kullback-Leibler divergence ( D KL ).
The reverse D KL can offer complementary advantages (e.g. by promoting mode-seeking rather than modecovering (Turner and Sahani, 2011)), but is hard to compute and optimise for conventional density estimation approaches.
We here show how GATSBI, by using an approach similar to adversarial variational inference, performs an optimization that also ﬁnds a minimum of the reverse D KL .
First, we note that density estimation approaches for SBI involve maximising the approximate log posterior over samples simulated from the prior.
This is equivalent to minimising the forward D KL :
[Equation]
[Equation]
rather than reverse D KL :
[Equation]
This is because it is feasible to compute L fwd with an intractable likelihood: it only involves evaluating the approximate posterior under samples from the true joint distribution p ( θ, x )
=
p ( x | θ ) π ( θ ) .
The problem with the reverse D KL , however, is that it requires evaluating the true posterior p ( θ | x ) under samples from the approximate posterior q φ ( θ | x ) , which is impossible with an intractable likelihood.
This is a problem also shared by variational-autoencoders (VAEs, Kingma and Welling, 2013) but which can be solved using adversarial inference.
A VAE typically consists of an encoder network q φ ( u | x ) approximating the posterior over latents u given data x , and a decoder network approximating the likelihood p α ( x | u ) .
The parameters φ and α of the two networks are optimised by maximising the Evidence Lower Bound (ELBO):
[Equation]
Note that the D KL is minimised when maximising the ELBO.
If any of the distributions used to compute the ratio in the D KL in equation 6 is intractable, one can do adversarial inference, i.e., the ratio can be approximated using a discriminator (see Proposition 1) and q φ ( u | x ) is recast as the generator.
Various adversarial inference approaches approximate different ratios, depending on which of the distributions is intractable (see App.
Table 1 for a non-exhaustive comparison of different discriminators and corresponding losses), and their connection to GANs has been explored extensively (Chen et al., 2018;
Hu et al., 2017; Mohamed and Lakshminarayanan, 2016; Srivastava et al., 2017).
Recasting SBI into the VAE framework, the intractable distribution is the likelihood p
α
( x | θ ) , 2 and α is a constant, i.e., the simulator only has parameters to do inference over.
Accordingly, p ( x ) is deﬁned as the marginal likelihood.
In this setting, the objective for SBI becomes the reverse D KL , and we can use an adversarial method, e.g. GATSBI, to minimise it for learning the posterior q φ ( θ | x ) .
There is an additional subtlety at play here: GATSBI’s generator loss, given an optimal discriminator, is not the reverse D KL , but the JSD (see Proposition 1).
However, following the proof for Proposition 3 in
Mescheder et al.
(2017), one can show that the approximate posterior that minimises the JSD also maximises the ELBO (see App. A.3).
Thus, GATSBI is an adversarial inference method that can be used to perform SBI using the reverse D KL .
Note that the converse is not true: not all adversarial inference methods can be adapted for SBI.
Speciﬁcally, some adversarial inference methods require explicit evaluation of the likelihood.
Of those methods listed in Table 1, only likelihood-free variational inference (LFVI)
(Tran et al., 2017) is explicitly used to perform inference for a simulator with intractable likelihood.
LFVI is deﬁned as performing inference over latents u and global parameters β shared across multiple observations x , which are sampled from an empirical distribution p (cid:48)
( x ) (cid:54) =
p ( x ) , i.e., it learns q φ ( u, β | x ) .
However, if p (cid:48) ( x ) = p ( x ) , and β is constant, i.e., the simulator does not have tunable parameters (but only parameters one does inference over) then LFVI and GATSBI become (almost) equivalent: LFVI differs by a single term in the loss function, and we empirically found the methods to yield similar results (see App.
Fig. 6).
We discuss LFVI’s relationship to GATSBI in more detail in App. A.3.
2. S EQUENTIAL GATSBI
The GATSBI formulation in the previous sections allows us to learn an amortised posterior p ( θ | x ) for any observation x .
However, one is often interested in good posterior samples for a particular experimental observation x o —and not for all possible observations x .
This can be achieved by training the density estimator using samples θ from a proposal prior ˜ π ( θ ) instead of the usual prior π ( θ ) .
The proposal prior ideally produces samples θ that are localised around the modes of p ( θ | x o ) and can guide the density estimator towards inferring a posterior for x o using less training data.
To this end, sequential schemes using proposal distributions to generate training data over several rounds of inference (e.g. by using the approximate posterior from previous rounds as the proposal prior for subsequent rounds) can be more sample efﬁcient (Lueckmann et al., 2021).
Sequential GATSBI uses a scheme similar to other sequential SBI methods (e.g., Greenberg et al., 2019; Hermans et al., 2020; Lueckmann et al., 2017; Papamakarios and Murray, 2016; Papamakarios et al., 2019): the generator from the current round of posterior approximation becomes the proposal distribution in the next round.
However, using samples from a proposal prior ˜ π ( θ ) to train the GAN would lead to the GATSBI generator learning a proposal posterior ˜ p
( θ | x ) rather than the true posterior p ( θ | x ) .
Previous sequential methods solve this problem either by post-hoc correcting the learned density (Papamakarios and Murray, 2016), by adjusting the loss function (Lueckmann et al., 2017), or by reparametrizing the posterior network (Greenberg et al., 2019).
While these approaches might work for GATSBI (see App.
A.4 for an outline), we propose a different approach: at training time, we sample the latents z —that the generator transforms into parameters θ —from a corrected distribution p t ( z ) , so that the samples θ are implicitly generated from an approximate proposal posterior ˜ q φ ( θ | x ) :
[Equation]
where p t ( z ) = p ( z ) ( ω ( f φ ( z, x ) , x )) − 1 , ω ( θ, x )
=
π ( θ )
˜
π ( θ ) ˜
p ( x ) p ( x ) , and ˜ p ( x ) is the marginal likelihood under samples from the proposal prior.
Since ˜ π ( θ ) , p ( x ) and ˜ p ( x ) are intractable, we approximate ω
( θ, x ) using ratio density estimators for π ( θ ) ˜
π ( θ ) and ˜ p ( x ) p ( x ) . This ensures that at inference time, the GATSBI generator transforms samples from p ( z ) into an approximation of the true posterior p ( θ | x ) with highest accuracy at x = x o (see App.
A.4, B).
Azadi et al.
; Che et al.
(2020) use similar approaches to improve GAN training.
Note that this scheme may be used with other inference algorithms evaluating a loss under approximate posterior samples, e.g. LFVI (see Sec. 2.4).
R ESULTS
We ﬁrst investigate GATSBI on two common benchmark problems in SBI (Lueckmann et al., 2021).
We then show how GATSBI infers posteriors in a high-dimensional regime where most state-of-the-art
SBI algorithms are inadequate, as well as in a problem with an implicit prior (details in App.
D.1).
3. B ENCHMARK PROBLEMS
We selected two benchmark problems with low-dimensional posteriors on which state-of-the-art SBI algorithms have been tested extensively.
We used the benchmarking-tools and setup from Lueckmann et al.
Brieﬂy, we compared GATSBI against ﬁve SBI algorithms: classical rejection ABC (Tavaré et al., 1997, REJ-ABC), sequential Monte Carlo ABC (Beaumont et al., 2009, SMC-ABC) and the single-round variants of ﬂow-based neural likelihood estimation (Papamakarios et al., 2019,
NLE), ﬂow-based neural posterior estimation (Greenberg et al., 2019; Papamakarios and Murray, 2016, NPE) and neural ratio estimation (Durkan et al., 2020; Hermans et al., 2020, NRE).
GANs have previously been shown to be poor density estimators for low-dimensional distributions (Zaheer et al., 2017).
Thus, while we include these examples to provide empirical support that GATSBI works, we do not expect it to perform as well as state-of-the-art SBI algorithms on these tasks.
We compared samples from the approximate posterior against a reference posterior using a classiﬁer trained on the two sets of samples (classiﬁcation-based two-sample test, C2ST).
A C2ST accuracy of 0.5 (chance level) corresponds to perfect posterior estimation.
“Simple Likelihood Complex Posterior” (SLCP) is a challenging SBI problem designed to have a simple likelihood and a complex posterior (Papamakarios et al., 2019).
The prior π ( θ ) is a 5dimensional uniform distribution and the likelihood for the 8-dimensional x is a Gaussian
whose
[Figure]
mean and variance are nonlinear functions of θ .
This induces a posterior over θ with four symmetrical modes and vertical cut-offs (see App.
Fig.
7), making it a challenging inference problem.
We trained all algorithms on a budget of 1k, 10k and 100k simulations.
The GATSBI C2ST scores were on par with NRE, better than REJ-ABC and SMC-ABC, but below the NPE and NLE scores (Figure 2 A ).
The “Two-Moons Model” (Greenberg et al., 2019) has a simple likelihood and a bimodal posterior, where each mode is crescent-shaped (see App.
Fig.
Both x and θ are two-dimensional.
We initially trained GATSBI with the same architecture and settings as for the SLCP problem.
While the classiﬁcation score for GATSBI (see Figure 2 B ) was on par with that of REJ-ABC and SMC-ABC for 1k simulations, performance did not signiﬁcantly improve when increasing training budget.
When we tuned the GAN architecture and training hyperparameters speciﬁcally for this model, we found a performance improvement.
Lueckmann et al.
(2021) showed that performance can be signiﬁcantly improved with sequential inference schemes.
We found that although using sequential schemes with
GATSBI leads to small performance improvements, it still did not ensure performance on-par with the ﬂow-based methods (see App.
Fig. 9).
Moreover, since it had double the number of hyperparameters as amortised GATSBI, sequential GATSBI also required more hyperparameter tuning.
3. H IGH - DIMENSIONAL INFERENCE PROBLEMS
We showed above that, on low-dimensional examples, GATSBI does not perform as well as the best SBI methods.
However, we expected that it would excel on problems on which GANs excel: high-dimensional and structured parameter spaces, in which suitably designed neural networks can be used as powerful classiﬁers.
We apply GATSBI to two problems with ∼ 100-dimensional parameter spaces, one of which also has an implicit prior.
Shallow Water Model
The 1D shallow water equations describe the propagation of an initial disturbance across the surface of a shallow basin with an irregular depth proﬁle and bottom friction (Figure 3 A ).
They are relevant to oceanographers studying the dynamics on the continental sea shelf (Backhaus, 1983; Holton, 1973).
We discretised the partial differential equations on a 100-point spatial grid, obtaining a simulator parameterised by the depth proﬁle of the basin, θ ∈ R 100 (substantially higher than most previous SBI-applications, which generally are ≈ 10 dim).
The resulting amplitude of the waves evolving over a total of 100 time steps constitutes the 10k-dimensional raw observation from which we aim to infer the depth proﬁle.
The observation is taken into the Fourier domain, where both the real and imaginary parts receive additive noise and are concatenated, entering the inference pipeline as an array x ∈ R 20 k .
Our task was to estimate p ( θ | x ) , i.e., to infer the basin depth proﬁle from a noisy Fourier transform of the surfaces waves.
We trained GATSBI with 100k depth proﬁles sampled from the prior and the resulting surface wave simulations.
For comparison, we trained NPE and NLE on the same data, using the same embedding net as the GATSBI discriminator to reduce the high dimensionality of the observations x ∈ R 20 k to R 100 .
[Figure]
Samples from the GATSBI posterior captured the structure of the underlying ground-truth depth proﬁle (Figure 3 B , left).
In comparison, only
NPE, but not NLE, captured the true shape of the depth proﬁle (Figure 3 C,
D , left).
In addition, the inferred posterior means for GATSBI and NPE, but not NLE, were correlated with the ground-truth parameters ( 0 . 88 ± 0 .for
GATSBI and 0 .
91 ± 0 .
09 for NPE, mean ± standard deviation across 1000 different observations).
Furthermore, while GATSBI posterior predictive samples did not follow the ground-truth observations as closely as NPE’s, they captured the structure and were not as phase-shifted as NLE’s (Figure 3 B-D ).
This is expected since wavepropagation speed depends strongly on depth proﬁle, and thus incorrect inference of the depth parameters leads to temporal shifts between observed and inferred waves.
Finally, simulation-based calibration (SBC) (Talts et al., 2020) shows that both NPE and GATSBI provide well-calibrated posteriors on this challenging, 100 dimensional inference problem (clearly, neither is perfectly calibrated, Figure 4).
This realistic simulator example illustrates that GATSBI can learn posteriors with a dimensionality far from feasible for most SBI algorithms. It performs similar to NPE, previously reported to be a powerful approach on high-dimensional inference problems (Lueckmann et al., 2021).
Noisy Camera Model Finally, we demonstrate a further advantage of GATSBI over many SBI algorithms: GATSBI (like LFVI) can be applied in cases in which the prior distribution is only speciﬁed through an implicit model.
We illustrate this by considering inference over images from a noisy and blurred camera model.
We interpret the model as a black-box simulator.
Thus, the clean images θ are samples from an implicit prior over images π ( θ ) , and the simulated sensor activations are observations x .
We can then recast the task of denoising the images as an inference problem (we note that our goal is not to advance the state-of-the-art for super-resolution algorithms, for which multiple powerful approaches are available, e.g. Kim et al., 2016; Zhang et al., 2018).
Since images are typically high-dimensional objects, learning a posterior over images is already a difﬁcult problem for many SBI algorithms – either due to the implicit prior or the curse of dimensionality making MCMC sampling impracticable.
However, the implicit prior poses no challenge for GATSBI since it is trained only with samples.
We chose the EMNIST dataset (Cohen et al., 2017) with 800k 28 × 28-dimensional images as the implicit prior.
This results in an inference problem in a 784-dimensional parameter space—much higher dimensionality than in typical SBI applications.
The GATSBI generator was trained to produce clean images, given only the blurred image as input, while the discriminator was trained with clean images from the prior and the generator, and the corresponding blurred images.
GATSBI indeed recovered crisp sources from blurred observations: samples from the GATSBI posterior given blurred observations accurately matched the underlying clean ground-truth images (see Figure 5).
In contrast,
NPE did not produce coherent posterior samples, and took substantially longer to train than GATSBI (NLE and NRE are not applicable due to the implicit prior).
x o
M ean
S D
M ean
S D      0.
G r ound t r u t h
G A T S B I
N PE
D ISCUSSION
We proposed a new method for simulation-based inference in stochastic models with intractable likelihoods.
We used conditional GANs to ﬁt a neural network functioning as an implicit density, allowing efﬁcient, scalable sampling.
We clariﬁed the relationship between GANs and SBI, and showed how our method is related to adversarial VAEs that learn implicit posteriors over latent variables.
We showed how GATSBI can be extended for sequential estimation, ﬁne-tuning inference to a particular observation at the expense of amortisation.
In contrast to conventional densityestimation based SBI-methods, GATSBI targets the reverse D KL —by thus extending both amortised and sequential SBI, we made it possible to explore the advantages of the forward and reverse D KL .
We found GATSBI to work adequately on two low-dimensional benchmark problems, though it did not outperform neural network-based methods.
However, its real potential comes from the ability of GANs to learn generative models in high-dimensional problems.
We demonstrated this by using
GATSBI to infer a well-calibrated posterior over a 100-dimensional parameter space for the shallow water model, and a 784-dimensional parameter space for the camera model.
This is far beyond what is typically attempted with SBI: indeed we found that GATSBI outperformed NPE on the camera model, and performed similarly to NPE and substantially outperformed NLE on the shallow water model (both SBI approaches were previously shown to be more powerful than others in high dimensions;
Lueckmann et al., 2021).
Moreover, we showed that GATSBI can learn posteriors in a model in which the prior is only deﬁned implicitly (i.e., through a database of samples, not a parametric model).
Despite the advantages that GATSBI confers over other SBI algorithms in terms of ﬂexibility and scalability, it comes with computational and algorithmic costs.
GANs are notoriously difﬁcult to train—they are highly sensitive to hyperparameters (as demonstrated in the two-moons example) and problems such as mode collapse are common.
Moreover, training time is signiﬁcantly higher than in other SBI algorithms.
In addition, since GATSBI encodes an implicit posterior, i.e., a density from which we can sample but cannot evaluate, it yields posterior samples but not a parametric model.
Thus, GATSBI is unlikely to be the method of choice for low-dimensional problems.
Similarly, sequential GATSBI requires extensive hyperparameter tuning in order to produce improvements over amortised GATSBI, with the additional cost of training a classiﬁer to approximate the correction factor.
Hence, sequential GATSBI might be useful in applications where the computational cost of training is offset by having an expensive simulator.
We note that GATSBI might beneﬁt from recent improvements on GAN training speed and sample efﬁciency (Sauer et al., 2021).
Overall, we expect that GATSBI will be particularly impactful on problems in which the parameter space is high-dimensional and has GAN-friendly structure, e.g. images.
Spatially structured models and data abound in the sciences, from climate modelling to ecology and economics.
High-dimensional parameter regimes are common, but inaccessible for current SBI algorithms.
Building on the strengths of GANs, we expect that GATSBI will help close this gap and open up new application-domains for SBI, and new directions for building SBI methods employing adversarial training.
E THICS STATEMENT
Since this is a purely exploratory and theoretical work based on simulated data, we do not foresee major ethical concerns.
However, we also note that highly realistic GANs have a potential of being exploited for applications with negative societal impacts e g. deep fakes (Tolosana et al., 2020).
R EPRODUCIBILITY STATEMENT
To facilitate reproducibility we provide detailed information about simulated data, model set up, training details and experimental results in the Appendix.
In order to avoid de-anonymization issues, we will only release code upon publication