I Introduction
Often, rather than just learning to approximate a function mapping from input to output, we want to learn to generate samples randomly according to some distribution which is specified implicitly via data (most commonly data drawn from that distribution directly, or drawn from an associated conditional distribution). For example, one might want to generate the distribution of images which could be classified as a cat, or the distribution of actions which would all lead to an agent’s behavior satisfying some constraint, or abstractly the distribution of predictions which would be consistent with a given set of observations. Having access to the distribution of outcomes can help detect anomalies, maintain uncertainty information throughout a complex model flow, or permit optimization over implicit options associated with the residual entropy of the generated distributions. Sometimes, rather than generating the distribution of data itself, we would like to generate a related distribution instead. If for example we were training an agent on a new environment, and some outcomes were extremely common in the data we had accumulated so far, we could optimize the agent’s exploration by trying to shift the distribution of actions attempted in order to flatten the distribution of outcomes. That way, if there are rare patterns of actions which can achieve very different outcomes, we could enhance the sampling of those possibilities.
We can generally divide methods of producing diverse samples into two categories. One is to build a model that outputs the parameters of some distribution which we can sample from, such as a Gaussian distribution or explicit probabilities over a finite set of discrete outcomes. The other is to transform a distribution of inputs (such as by adding noise variables) into a distribution of outputs. The first method is used by things such as autoregressive models and mixture density networks
[1]. Meanwhile, the second method is used as the sole source of entropy by generative adversarial networks[2] and invertible flows[3], and is combined with the first method in the case of variational autoencoders (VAEs)[4].The problem with passing noise through a network in order to produce a distribution of outcomes is that when optimizing over the expectation value of a scalar loss function, the optimal solution is always a single point, not a distribution. As such, there is a pressure on such networks to collapse towards a weak estimate (say, of the mean of the target value) rather than to retain the entropy of the inputs. In invertible flows, this pressure is prevented from functioning via the application of the invertibility constraint — the entropy of the input cannot be decreased, and so the output remains a distribution. In VAEs, explicit regularization is used to reward the network for keeping the noise around. In GANs, the only thing maintaining the pressure is the dynamics of training, and so there are often issues with modecollapse as the entropy of the output distribution irreversibly decreases.
Recent work on timeagnostic prediction[5]
makes use of the technique of optimizing against the minimum of the loss over a set of outputs rather than the expectation. In that paper, the purpose is to give the network a degree of freedom in deciding which of a sequence of frames to ’try’ to predict. By using the minimum, so long as at least one element of the sequence is predicted well, the network is not penalized for errors in any of the other elements and as such is free to allow those elements to vary arbitrarily. There is a similarity between this idea and the idea of diversity preservation in genetic algorithms via the use of a minimal criterion for reproduction rather than using a fitness function
[6] — there as well, by constructing an objective function with large flat areas, those flat areas are free to be utilized in order to hedge against uncertainties.Based on this comparison, we consider what would happen if rather than using the minimum loss over a concrete variable such as time, we instead had a stochastic network and took the minimum loss over many samples from the distribution of the network’s output. We can then think of a batch of such samples, where we have simply replaced the batchwise expectation of the loss with the batchwise minimum over the loss. We show that in the context of regression problems training against the minimum regression loss between output and target causes the optimum output of the model to converge to the support of the distribution of possible outputs rather than to a single optimal point estimate as the number of samples becomes asymptotically large. Furthermore, it is possible to extend this to a generative model matching the distribution by simultaneously predicting the probability that each output will be selected as the minimum, and resampling according to that predicted probability.
Code for our numerical experiments is available at https://github.com/ngutten/ExtremeValueLoss.
Ii Related work
Mixture density networks (MDNs): Mixture density networks[1]
directly parameterize the output distribution with (generally) a sum of Gaussians, and then train the network to maximize the likelihood of the empirical distribution under the model. When the dimension of the target space is low, this is an effective way to capture complex multimodal structure in the joint distribution. However, the covariance matrices to specify each Gaussian grow quadratically in the dimension of the target space, and the number of Gaussians needed to fit a curved manifold structure in high dimension may likewise grow quickly. MDNs were used in SketchRNN
[7] to model the continuation of lines in drawing figures and kanji.Autoregressive models (ARs): One method for generating samples from a highdimensional distribution is to factorize the joint distribution into a product of onedimensional conditional probabilities: . These onedimensional distributions can each be learned separately by discretizing the possibilities and minimizing the categorical crossentropy or KL divergence. Alternately, if the variables have some structural relationship, such as words in a sentence or pixels in an image, then weight sharing and causal masking can be used to learn a single model which is able to generate all such distributions. Sampling from the distribution is done by sampling from each onedimensional distribution in turn, conditioning on the previous samples. Alternately, methods such as beamsearch can be used to find maximum likelihood outcomes or otherwise adjust the ’temperature’ of the generator. Methods which use this approach include CharRNN[8], PixelRNN[9], PixelCNN[10, 11], WaveNet[12]
, and Transformer networks
[13].A strong advantage of autoregressive models is that they permit explicit calculation of a differentiable probability density around a sample, meaning that they can be used for anomaly detection, importance sampling, or other applications which require that information. The primary disadvantages of autoregressive models are firstly that they must generally be sampled from sequentially (which makes them relatively slow compared to other methods when it comes to generation, in the worst case being effectively
in the data dimension), and secondly that when the variables in question do not share some equivalency such as in the case of structured data, a separate model must be trained for each variable. Autoregressive models also do not possess a readily manipulable latent space which maps to the output distribution, so they cannot be readily used for things such as embedding or interpolation between samples. Additionally, the actual sampling procedure is not itself differentiable, so using autoregressive models as a forward model of dynamics for subsequent optimization via gradient descent requires a reparameterization step which can introduce additional variance.
Boltzmann machines
: For binary data, Boltzmann machines
[14]and Restricted Boltzmann machines (RBMs)
[15] can directly learn an energy function over the space, such that the Boltzmann distribution over the space is matched to the empirical distribution.Boltzmann machines provide a direct estimation of the likelihood of samples, which can be useful for other applications. In the form of the hidden nodes, Boltzmann machines can learn a discrete latent space representing distributions over samples. However, Boltzmann machines are constrained in that the energy function must be constrained such that marginalization over the latent degrees of freedom can be done analytically, otherwise extensive MonteCarlo simulation is needed for every update. This is generally a quadratic model with (in the case of the RBM) no withinlayer links. This can make them tricky to generalize to new domains.
Invertible flows
: This set of methods belongs to the class of techniques which learn a map between an easily generated distribution (such as a high dimensional Gaussian) and a target distribution. The idea is that, if the learned map is invertible, then it is possible to take a point in the target space, find its preimage in the original distribution, and (in combination with the Jacobian of the map) thereby calculate its probability density. If the probability density of samples can be calculated, then the map can be optimized via gradient descent to minimize the KL divergence between the empirical distribution and generated distribution. In order to do this, the map itself cannot be an arbitrary neural network, but must be constructed out of layers for which the existence of an inverse can be guaranteed (and for which the inverse is easily constructed). The general structure of this is that alternating subsets of the dimensions are transformed according to an invertible matrix constructed from an arbitrary function of the residual dimensions, so that with respect to inversion all that is needed is to invert (what can be treated as) a constant matrix at each step. Examples of work which develops these methods are Normalizing Flows
[3], RealNVP[16], and Glow[17].Like autoregressive models, invertible flows provide a probability density around generated samples. Furthermore, the latent space associated with the source distribution can be used to embed points and disentangle independently varying factors from within the full distribution. The primary downsides are that these models tend to require a much greater depth than other methods (generally hundreds of layers), and due to the invertibility constraint they must maintain a constant width equal to the output dimension. As a result, though sample quality is good, methods such as Glow (which used 576 convolutional layers for the highest resolution experiments) can be relatively resource intensive to train.
Variational Autoencoders (VAEs): These methods[4, 18] work by transforming input samples into a latent embedding space, imposing a distribution on that space by adding noise as well as an appropriate KL divergence in the loss function, and then decoding the latent representations back into the original samples (using for example a Gaussian model). In order to use this as a generative model, one can sample and decode points from the latent space according to the imposed distribution. If the actual topology of the data distribution is poorly matched to the imposed distribution in the latent space, this method may assign a high likelihood to samples that are actually very unlikely. As such, there are a variety of methods which impose more flexible distributions on the latent space[19, 20, 21]. Additionally, by doing a series of MonteCarlolike resamplings of generated samples (essentially repeatedly encoding and decoding them), points which lie far from the data distribution end up getting mapped back into it[22].
VAEs are a very flexible framework — multiple hierarchical latent spaces can be readily used, just by constructing the appropriate noise sources and KL divergence terms to add to the loss. One limitation is that one must specify a metric or parameterized probability distribution on the sample space — generally meansquared error, which corresponds to an isotropic Gaussian model. If this metric is poorly matched to the type of data being reconstructed, the resulting model tends to have a strong bias towards modecollapsed or ’blurry’ reconstructions, essentially outputting the mean of the data distribution.
Generative adversarial networks (GANs): Generative adversarial networks use a pair of networks in order to effectively estimate, then minimize, the difference between two data distributions. The discriminator network tries to classify samples as belonging to either the true or fake distribution, while the generator network uses the gradients propagated through the discriminator to try to fool it. The Nash equilibrium of this game is the point at which the fake and true distributions are identical. Due to training instability and phenomena such as mode collapse, there have been a number of refinements on the basic GAN idea such as LSGAN[23], Unrolled GANs[24], WGAN[25], WGANGP[26], Relativistic GANs[27], as well as fusing GANs with other techniques such as in VAEGAN[28], BEGAN[29], etc. Very high resolution outputs have been achieved by progressively stacking generators at a sequence of scales (Progressive GANs[30]).
GANs can produce highquality samples and retain the advantage of having a latent space to index the output distribution. However, training tends to be unstable, and among the various methods there tends to be a tradeoff between convergence and stability (with WGAN producing more stable training, but ultimately slightly worse converged results than the initial DCGAN[31] formulation). GANs also do not produce a probability density associated with each sample.
Iii Method
Let us consider a problem in which a model is provided some information and is being optimized to minimize the expectation of a loss function comparing outputs to targets . From the information about contained in , there is some conditional distribution which could in principle be discovered e.g. in the limit of infinite data. What should the model output in this case?
If we consider the case of a particular value of , then there is some distribution of targets and therefore, for any single value of , some expectation over that distribution of the observed loss . Therefore, if the model produces some distribution of outputs , the expected loss is:
(1) 
This expectation is minimized when is a function at the global minimum value of , and so the optimal behavior for a model when trained against the expectation of a loss function is to output a single value, even if spare entropy e.g. in the form of auxiliary noise inputs is available.
Now let us instead consider the case where, for each fixed , we optimize the reduce to minimum over a set of loss values associated with different samples from some auxiliary noise distribution . This auxiliary distribution is added as an additional input to the network, meaning that becomes for each value sampled from . This gives rise to a new effective loss: process is:
(2) 
So long as for some value of , then this loss will be at a global minimum — that is to say, this loss is minimized so long as covers the support of . If we approximate this loss with a finite but large number of samples from , then the loss can be reduced if the support of exactly matches the support of rather than simply covering it. That is to say, the optimal strategy of the model in practice will be to align the support of the two distributions.
Note that the actual probability densities and need not match in either of these cases to be at a global optimum — it will instead converge to some related distribution based on the shape of the loss function around its optimum. If the loss function is concave up (e.g. it’s behavior around zero scales as for
) then small deviations are weighted less significantly than large deviations, and so even for a small number of samples the tendency will be to rapidly produce a uniform distribution over the support. On the other hand, if the function is concave down (
) then small deviations are infinitely more significant than large deviations as the deviations approach zero, meaning that the model will tend to concentrate it’s predictions according .If we consider the other extremal loss, taking the maximum over the batch, then this reinforces the function output behavior even more strongly than the expectation would.
Iv Connection between extreme value loss and mixture density networks
An alternate method for modelling distributions is to parameterize a functional representation of the distribution itself, and then optimize the prediction of those parameters with respect to the log likelihood of the data under the corresponding predicted distribution. While any analytically tractable parameterization of a distribution may be used here, one convenient choice is to make use of a sum of Gaussian distributions, such that (in 1d, for example):
(3) 
with .
If we consider the different Gaussian distributions to effectively be separate guesses, this method can be related to the idea of using a different function than the mean to summarize the losses over a set of samples. Although in a mixture density framework these guesses could be dependent on oneanother, we can imagine the case in which the guesses were independently sampled from a distribution . In that case, we can replace the expectation over a particular set of guesses with an expectation over the parameters which identify the distribution of guesses:
(4) 
For simplicity, we look at the case where . In that case (up to a constant offset), the loss corresponding to the loglikelihood of the data given the model is:
(5) 
or, in integral form:
(6) 
Note that, unlike a pointwise loss, the expectations do not commute with eachother because of the . That is to say, we cannot simply move the integral to inside the , find some effective loss, and then take the expectation over with respect to that effective function of alone.
If we look at the innermost integral, we can approximate the integral by its value at the maximum of the function :
(7) 
If the term were constant, then this corresponds exactly to the meansquared error loss evaluated at the closestmatching guess contained within the support of the distribution . With the term, however, there is an additional pressure that the distribution should be concentrated around the guesses which turn out to be close to — which, practically speaking, would be the difference between optimizing to be uniform over the support of , versus optimizing to minimize divergence with .
Iva Generating the distribution
Using the connection to mixture density networks, we can see that holding constant corresponds to modelling the support of the distribution, while allowing to vary to maximize the likelihood of the accepted guesses under a probabilistic model corresponds to modelling the distribution itself. We can obtain this same effect for the extremal loss method by having the network not just output coordinates of samples, but also training it to output an estimated probability for each sample of that particular sample being chosen as the extreme value — corresponding to learning the function
. This is done by outputting an extra channel which is then interpreted as the logits over the batch for a softmax function, then training against the categorical crossentropy loss.
We then have two distributions: , corresponding to the pattern of samples produced by a pushforward transform of noise inputs to the network, and , which is a learned relative probability associated with each sample in a generated batch of samples. The distribution is pushed towards capturing the support or the overall topology of the data, whereas the function is pushed towards capturing variations in relative probability density among things which can be assumed to be within the support. The advantage of this method is that by factoring out explicit modelling of the likelihoods associated with points far away from the data manifold, the overall variation of the function is reduced and it’s behavior far from the boundaries of the data distribution becomes irrelevant. On the other hand, learning directly means that the behavior of the function far from data can contribute strongly to the overall normalization factor while being only indirectly supervised from the data.
In order to generate samples to match the underlying distribution, we then simply generate a batch of samples according to and reject samples based on the probability distribution over the batch given by : .
V Lowdimensional Test Cases
We first look at modelling distributions in sufficiently low dimension such that we may directly estimate divergences to the known true distribution via accumulating histograms over samples. This allows us to evaluate how well each method converges to the underlying distribution without relying on qualitative or indirect methods. We will consider both data formed of multiple Gaussians in up to 4 dimensions, as well as the 3d ’swiss roll’ function.
Because the extremal loss method is expected to converge to the support of the distribution rather than the distribution itself, we use rejection sampling according to the probability predicted by the model that each sample from a batch will be chosen as the minimum. The network used in these experiments is a dense network comprised of 5 layers with ReLU activation functions, each of width 256, where the input is 16 dimensional unitGaussian noise. Each layer is initialized orthogonally
[32], using gain as appropriate to ReLU. The batch size is taken to be , and for each sample from the batch we generate independent attempts over which we will compute the minimal (meansquared error) loss. The network is trained over epochs using RMSprop[33], with a learning rate starting at and decreasing by a factor of each epoch. The meansquared reconstruction loss and probabilistic loss are weighted equally.These parameters were found via search against a validation set (corresponding to random seed 81379). The most significant contributors to performance were using RMSprop instead of Adam (which was introducing some oscillatory instabilities) and increasing the number of samples over which the extremal loss was evaluated. The decaying learning rate was important in obtaining convergence when close to the true distribution, though is not necessary for stability or for initial capture of the broad shape of the distribution.
We compare the extreme value loss network with three other baselines: an empirical estimate of the distribution, a Gaussian mixture model, and an unrolled relativistic GAN.
Empirical distribution: The simplest baseline is to estimate the empirical distribution via computing the histogram of the training data directly. In essence, this corresponds to approximating the distribution with a basis set of highdimensional step functions. As a baseline, this has the advantage of strong convergence (given an infinite number of samples for both the training and test sets, the divergence will asymptotically be zero). However, as the dimensionality of the system increases, the empirical distribution is expected to become increasingly sample inefficient.
Gaussian Mixture Model: We use the ScikitLearn[34] implementation of Gaussian mixtures, and set the number of components to predict to in all tests. As one of our test cases will be a data distribution which is actually sampled from a mixture of Gaussians, this baseline will let us determine how well a model can do when it has apriori correct knowledge of the (parameterized) function family from which the data is drawn, and when we compare to nonGaussian datasets we can use this baseline to see how well those assumptions generalize.
Unrolled relativistic GAN: Our two baselines so far do not generalize well to highdimensional cases such as the space of natural images. Generative adversarial networks, while being known for suffering from mode collapse issues, do successfully capture the characteristics of photorealistic images in the highdimensional case. As such, we would like to compare with a GANbased method. The basic GAN proved too unstable to produce consistent estimates of divergences to the data distribution, especially in the multimodal cases. However, with a combination of unrolled GAN and relativistic GAN we were able to suppress oscillations and mode collapse, and observe reasonable convergence on a 4Gaussian validation set in 2d (seed 81379). We used a network architecture similar in terms of depth, activation functions, and training method to that of the extreme value loss network for both the generator and discriminator, aside from the input and output dimensions, which are given by the GAN architecture constraints. Experiments with network geometry showed that a network width of was more stable than the value of 256 used for the extreme value loss network, and so we report results using that value.
Va Evaluation
We use two measures to evaluate the difference between the model distribution and test distribution : the KL divergence and the Fisher information metric.
The KL divergence from the model distribution to the test distribution is:
(8) 
In practice, if the supports of the empirical distributions disagree then this sum may diverge (either due to the argument of the becoming zero due to , or becoming infinite when ). As such, we regularize the empirical distributions and by adding a virtual sample with weight to each bin. When the supports disagree due to smallnumber statistics, each such bin contributes an error in estimating the KL divergence of order where is the total number of samples. This corresponds to an error floor of about . When there is a systematic difference in supports, however, the way that this is weighted relative to differences in the probability densities depends systematically on the choice of this regularization term, and so the KL divergence becomes unreliable in that case.
To resolve this, we also look at the Fisher information metric between the distributions, which can be measured via the geometric mean of the distributions
[35]:(9) 
This metric does not diverge if the supports disagree, and so is more stable against sampling noise in estimating the empirical distribution.
VB Results
VB1 Gaussian Dataset
We use data sampled from mixtures of
unitGaussians of equal magnitude in 1d, 2d, 3d, and 4d. We look at datasets comprised of 1, 2, 4, and 10 Gaussians in order to investigate the degree to which the methods can capture multimodel distributions. To produce these datasets, we generate unitstandard deviation Gaussians whose centers are uniformly positioned over the range
. This range is selected so that even in 1d we will tend to see multiple distinct peaks as we increase the number of modes. For each dimension and number of Gaussians, we generate 5 datasets (random seeds from to ) and train each of the baseline models and the extreme value loss network.The results for a training set size of are shown for the KL divergence and Fisher metric in Fig. 1. In general, the ordering of the four models is almost universally preserved across this set of experiments, with the Gaussian Mixture Model (GMM) performing the best, the empirical distribution second, the extreme value loss network (EVL) third, and finally the unrolled relativistic GAN. The GMM incorporates correct groundtruth information as to the nature of the underlying distribution, so it’s performance should not be considered particularly surprising. When it comes to the other models, for this number of samples at least we can see that while the GAN and EVL do attempt to capture the structure of the empirical distribution (which comprises the training set), they do so incompletely. We note that along with having a higher divergence from the underlying data distribution, the GAN training also results in significantly larger error bars — the underlying distribution of errors between runs is not Gaussian, but rather appears to be bimodal, suggesting that this may just indicate that the GAN occasionally fails to converge entirely, but may perform better than indicated by the mean in cases in which it does not totally diverge.
While the empirical distribution outperforms the two networkbased approaches here, if we look at the absolute scale of the divergences we note that they are quite small in 1d and 2d: about nats in 1d and nats in 2d as the worst cases. As such, if the purpose for training the model is not just to generate samples but, for example, to learn a differentiable parameterization (which would not be available from either the empirical baseline or Gaussian Mixture baseline) then this may be sufficiently good to pursue that end.
We also consider what happens in the limit of smaller training sets comprised of samples. The results are shown in Fig. 2. In this case, the empirical distribution becomes extremely sparse in the higher dimensional cases. Here we can see that the extreme value loss network actually outperforms the empirical distribution (despite having no explicit prior knowledge about the function space) in terms of KL divergence, and performs comparably with respect to the Fisher metric. This difference makes sense in the context of the extreme value loss having a bias towards ensuring overlapping support, which is more important with respect to the KL divergence than it is to the Fisher metric.
VB2 Swiss roll dataset
Here we present results of the extreme value loss on the swiss roll dataset (as generated by ScikitLearn’s make_swiss_roll function with noise set to , and scaled by so that they line within the same domain as the multiGaussian test case presented above). We generate training set values and test set values, and compare the various methods discussed in the prior section. The same parameters as in the previous section are used for all methods. The resulting generated distributions are shown in Fig. 3, projected down into the 2 varying dimensions (the third dimension of the swiss roll dataset is included for evaluating divergences, and has significant consequence for the performance of the Gaussian Mixture Model in particular). The corresponding KL divergence and Fisher metric for the various methods are reported in Table I.
Method  KL  Fisher 

Empirical  0.054  0.126 
GMM  0.312  1.294 
Extreme Value Loss  0.204  0.411 
Unrolled GAN  0.246  0.647 
Notably, while the empirical distribution is still the best representation of the underlying distribution for this amount of data, the Gaussian Mixture Model now fails almost completely to capture the structure of the dataset (which makes sense, as the underlying function spaces now differ). On the other hand, the unrolled relativistic GAN and the extreme value loss network both manage to capture the structure of the dataset and sharply reproduce the spiral pattern, though the extreme value loss network obtains quantitatively better KL divergence and Fisher metric values.
Vi Highdimensional data
In the previous case, we consider the extreme value loss in the context of low dimensional data distributions. However, the usual context in which neural network based generative modelling is considered is in the production of realistic highdimensional objects such as images or sounds. Here we hit a potential limitation of the extreme value loss approach to generating diverse distributions. Each time the network generates a set of guesses, those guesses should be distributed such that there is a high probability that at least one guess is close to the target point. As such, the guesses should be positioned to cover the space of fluctuations of the target. If the target point has fluctuations which are inherently highdimensional (with respect to the choice of metric used to compare points), then the number of guesses needed to cover that space grows exponentially with the dimension. Correspondingly, the benefit to be gained by adding additional guesses will be exponentially reduced compared to simply making a single guess. On the other hand, if the target point lies on a lowdimensional manifold, then this may not pose a problem and the network will learn a map over that subspace of fluctuations.
We consider two image datasets — MNIST[36] digits, and CIFAR10[37]. The MNIST dataset has objects of dimensions , while CIFAR10 has objects of dimension , so these are roughly comparable (and both are much higher in dimension than the cases we considered in the previous section). However, while MNIST digits are fairly regular (to the extent that the image of the ’average digit’ has recognizable structures in it), the CIFAR images are much higher entropy due to factors such as variations in the background and lighting.
It is wellestablished that carefully calibrated generative adversarial networks can produce realistic samples from image datasets, whether or not they model the actual underlying distribution of images. Datasets such as MNIST are easy problems in this context, with modern GANs (such as Progressive GANs) being able to attain resolutions up to . As such, rather than training an MNIST or CIFAR GAN baseline to compare with, we keep in mind that from the point of view of alternate methods this is essentially a solved problem. Our interest, in this section, is more to understand the failure modes of using a method such as extreme value loss to train generative models as the dimensionality of the output becomes large.
In the following experiments, we tried a number of variations which made little difference, and so some hyperparameter choices are kept for ease of visualization rather than performance. Specifically, we only use a 2d latent space of input noise (increasing this to 16d led to no appreciable improvement on either MNIST or CIFAR sample quality). This allows us to render flat maps of the network’s entire generated space, which helps directly evaluate things such as the relative probability of each MNIST digit, the relationship between features, and the characteristics of interpolations across the space by eye. On the other hand, we found that the width of the network was quite important in terms of obtaining sharp samples in the case of MNIST, and increasing the network dimensions also led to some improvements in CIFAR sample quality. The final size of the networks we use here was chosen based on the 8gb GPU memory limit of our hardware rather than a measure of sample quality, and it seems as though increasing the network sizes further might lead to further (small) improvements. Increasing the number of guesses also led to small improvements in sample sharpness and quality, particularly in the case of the CIFAR images, but was also constrained by memory considerations.
The details of the architecture are as follows. We use a convolutional neural network architecture composed of blocks, where each block contains a linear upscaling operation that doubles the current image resolution, followed by two convolutional layers with
kernels and ReLU activations. The number of filters in each block are 512, 256, 128, 128, and 64 respectively. A final linearconvolution converts the output of this stack into the appropriate pixel representation (1 channel for MNIST, 3 channels for CIFAR). In parallel, the input noise vector is passed through 4 dense layers comprised of 256 units each and ReLU activations, and a final projection down to 1d which is then passed through a softmax activation to obtain the probability estimate that each guess is selected as the closest one (so that we can reconstruct the distribution through rejection sampling). All layers are orthogonally initialized, with a gain of
in the case of ReLU activations. We use RMSprop to optimize the model, with an initial learning rate of and an exponential decay by a factor of each epoch, and train the model for epochs. The loss function to compare generated samples to the target is mean squared error (we expect that to get photorealistic samples, this would need to be replaced with a perceptual loss or adversarial loss).Because this task is more memory intensive than the previous ones, we make use of the fact that the network’s output is independent of the sample that it is trying to match, and so rather than generating independent random samples for each image from the batch, we match each image from the training batch to its best match from a fixed generated set per batch. That is to say, if we use a batch size of 200 images and 128 generated attempts, rather than generating images we only need to generate , which we can then match. This allows us to scale the approach to larger sampling rates, which increases the probability of finding significant fluctuations. As a result, we are able to use a batch of size and generate guesses per pass (these guesses use the same noise vectors over a single batch, but independent ones between batches).
The results on MNIST and CIFAR are shown in Fig. 4 and Fig. 5 respectively. While we see relatively sharp reconstructions of the MNIST digits, it seems clear that while the CIFAR examples have reconstructed variations in the background and gradient, the pixellevel variations have been blurred out. This may in part be because of the mean squared error, which focuses on pixellevel correspondences and as such reconstructs longwavelength features in preference over shortwavelength features. If, for example, we used Gram matrices on VGG activations, we might expect to see a map covering the distribution of visually distinct textures instead. However, in either case, the entropy of the CIFAR images means that the network is not able to latch onto representative examples as it can do with MNIST.
In practice, this means that while extreme value loss networks on their own can stably match parts of distributions, in order to scale the technique to high dimensional data we would need a better way of associating a given target point with a closely matching guess (and, correspondingly, to correctly track the probability density associated with that guess). This may involve approaches such as an internal gradient descent step, factorization of the noise latents into a series of sequential decisions, or other techniques. Our purpose in this paper is to introduce the basic idea and map out it’s strengths and weaknesses towards different kinds of data and problems, so we leave these elaborations to future work.
Vii Conclusions
We observed that the default tendency of training against the expectation of a loss function over a dataset is to converge to outputting function distributions around a point estimate related to the conditional distribution, even when those point estimates are not representative of the distribution as a whole. However, by allowing the model to make multiple guesses and then selecting only the best guess to contribute to the overall loss, the model is rewarded for spanning the support of the distribution of possible targets. In combination with a model that predicts which guess will be chosen, this may be used to train a generative model that reproduces the distribution of targets, provides relative probability density estimates in that space, and learns a continuous map from a latent space into a corresponding manifold of representative targets which span the data.
We demonstrate that the technique converges to the distribution in lowdimensional cases in which we can directly estimate the KL divergence and Fisher Information Metric between generated and target distributions, and that the pattern of training is generally robust and reliably convergent. We also investigated the limits of the method, and showed that while high dimensional outputs do not necessarily pose a problem, when the outputs lie on a highdimensional or highentropy manifold then that can pose a problem and prevent the model from learning details of the data. We suggest that this may be alleviated by improving the quality of the random guesses through a variety of inneroptimizationloop strategies, essentially refining the guess so that fewer overall samples are needed in order for the model to take advantage of a large potential expressive space.
The practical applications of this technique most likely involve handling systems in which there is some highly nondifferentiable or stochastic element of the real map from input to output — for example, chaotic dynamical systems — but where one would still wish to for example take derivatives of summary statistics over the output relative to inputs or parameters. By indexing the distribution of possibilities, networks trained in this way learn representations which summarize the distribution rather than representing individual points. As such, while a chaotic system may exhibit a large change in outcome in response to a small change in initial conditions, it will not necessarily exhibit a large change in statistics in response to a small change in initial conditions, driving forces, or other parameters. The extreme value loss approach enables networks trained on regression tasks to capture that distinction, and as such may result in more stable longterm dynamics predictions, as well as a better ability to use learned models for differentiable planning.
Another potential application arises not from the stability and generative nature of models trained this way, but from the observation that the model learns to generate the support rather than the actual distribution. In importance sampling, one wishes to reweight their sampling strategy in order to reduce the variance of the estimator of a target observable as quickly as possible. This is ideally done by weighting each sample by the inverse of the probability density of the corresponding value of the observable associated with that sample. In essence, one wants to sample from a uniform distribution over the possible values of the observable — the supporting distribution — in order to maximize the convergence rate of estimates of that observable. Since a network trained against an extreme value loss rather than expectation over the loss converges to the support rather than the distribution, sampling from the network could be used as part of an importance sampling scheme.
Viii Acknowledgements
We would like to acknowledge Martin Biehl for helpful discussions, and Brent Werness for the suggestion to use the Fisher metric to compare distributions with differing support.
References
 [1] C. M. Bishop, “Mixture density networks,” Citeseer, Tech. Rep., 1994.
 [2] I. Goodfellow, J. PougetAbadie, M. Mirza, B. Xu, D. WardeFarley, S. Ozair, A. Courville, and Y. Bengio, “Generative adversarial nets,” in Advances in neural information processing systems, 2014, pp. 2672–2680.
 [3] D. J. Rezende and S. Mohamed, “Variational inference with normalizing flows,” arXiv preprint arXiv:1505.05770, 2015.
 [4] D. P. Kingma and M. Welling, “Autoencoding variational bayes,” arXiv preprint arXiv:1312.6114, 2013.
 [5] D. Jayaraman, F. Ebert, A. A. Efros, and S. Levine, “Timeagnostic prediction: Predicting predictable video frames,” arXiv preprint arXiv:1808.07784, 2018.

[6]
J. Lehman and K. O. Stanley, “Revising the evolutionary computation abstraction: minimal criteria novelty search,” in
Proceedings of the 12th annual conference on Genetic and evolutionary computation. ACM, 2010, pp. 103–110.  [7] D. Ha and D. Eck, “A neural representation of sketch drawings,” arXiv preprint arXiv:1704.03477, 2017.

[8]
I. Sutskever, J. Martens, and G. E. Hinton, “Generating text with recurrent neural networks,” 2018.
 [9] A. v. d. Oord, N. Kalchbrenner, and K. Kavukcuoglu, “Pixel recurrent neural networks,” arXiv preprint arXiv:1601.06759, 2016.
 [10] A. van den Oord, N. Kalchbrenner, L. Espeholt, O. Vinyals, A. Graves et al., “Conditional image generation with pixelcnn decoders,” in Advances in Neural Information Processing Systems, 2016, pp. 4790–4798.
 [11] T. Salimans, A. Karpathy, X. Chen, and D. P. Kingma, “Pixelcnn++: Improving the pixelcnn with discretized logistic mixture likelihood and other modifications,” arXiv preprint arXiv:1701.05517, 2017.
 [12] A. Van Den Oord, S. Dieleman, H. Zen, K. Simonyan, O. Vinyals, A. Graves, N. Kalchbrenner, A. W. Senior, and K. Kavukcuoglu, “Wavenet: A generative model for raw audio.” in SSW, 2016, p. 125.
 [13] A. Vaswani, N. Shazeer, N. Parmar, J. Uszkoreit, L. Jones, A. N. Gomez, Ł. Kaiser, and I. Polosukhin, “Attention is all you need,” in Advances in Neural Information Processing Systems, 2017, pp. 5998–6008.
 [14] D. H. Ackley, G. E. Hinton, and T. J. Sejnowski, “A learning algorithm for boltzmann machines,” Cognitive science, vol. 9, no. 1, pp. 147–169, 1985.

[15]
G. E. Hinton, “Training products of experts by minimizing contrastive divergence,”
Neural computation, vol. 14, no. 8, pp. 1771–1800, 2002.  [16] L. Dinh, J. SohlDickstein, and S. Bengio, “Density estimation using real nvp,” arXiv preprint arXiv:1605.08803, 2016.
 [17] D. P. Kingma and P. Dhariwal, “Glow: Generative flow with invertible 1x1 convolutions,” in Advances in Neural Information Processing Systems, 2018, pp. 10 235–10 244.
 [18] C. Doersch, “Tutorial on variational autoencoders,” arXiv preprint arXiv:1606.05908, 2016.
 [19] A. Makhzani, J. Shlens, N. Jaitly, I. Goodfellow, and B. Frey, “Adversarial autoencoders,” arXiv preprint arXiv:1511.05644, 2015.
 [20] N. Dilokthanakul, P. A. Mediano, M. Garnelo, M. C. Lee, H. Salimbeni, K. Arulkumaran, and M. Shanahan, “Deep unsupervised clustering with gaussian mixture variational autoencoders,” arXiv preprint arXiv:1611.02648, 2016.
 [21] E. Jang, S. Gu, and B. Poole, “Categorical reparameterization with gumbelsoftmax,” arXiv preprint arXiv:1611.01144, 2016.
 [22] A. Creswell, K. Arulkumaran, and A. A. Bharath, “Improving sampling from generative autoencoders with markov chains,” arXiv preprint arXiv:1610.09296, 2016.
 [23] X. Mao, Q. Li, H. Xie, R. Y. Lau, Z. Wang, and S. P. Smolley, “Least squares generative adversarial networks,” in Computer Vision (ICCV), 2017 IEEE International Conference on. IEEE, 2017, pp. 2813–2821.
 [24] L. Metz, B. Poole, D. Pfau, and J. SohlDickstein, “Unrolled generative adversarial networks,” arXiv preprint arXiv:1611.02163, 2016.

[25]
M. Arjovsky, S. Chintala, and L. Bottou, “Wasserstein generative adversarial
networks,” in
International Conference on Machine Learning
, 2017, pp. 214–223.  [26] I. Gulrajani, F. Ahmed, M. Arjovsky, V. Dumoulin, and A. C. Courville, “Improved training of wasserstein gans,” in Advances in Neural Information Processing Systems, 2017, pp. 5767–5777.
 [27] A. JolicoeurMartineau, “The relativistic discriminator: a key element missing from standard gan,” arXiv preprint arXiv:1807.00734, 2018.
 [28] A. B. L. Larsen, S. K. Sønderby, H. Larochelle, and O. Winther, “Autoencoding beyond pixels using a learned similarity metric,” arXiv preprint arXiv:1512.09300, 2015.
 [29] D. Berthelot, T. Schumm, and L. Metz, “Began: boundary equilibrium generative adversarial networks,” arXiv preprint arXiv:1703.10717, 2017.
 [30] T. Karras, T. Aila, S. Laine, and J. Lehtinen, “Progressive growing of gans for improved quality, stability, and variation,” arXiv preprint arXiv:1710.10196, 2017.
 [31] A. Radford, L. Metz, and S. Chintala, “Unsupervised representation learning with deep convolutional generative adversarial networks,” arXiv preprint arXiv:1511.06434, 2015.
 [32] A. M. Saxe, J. L. McClelland, and S. Ganguli, “Exact solutions to the nonlinear dynamics of learning in deep linear neural networks,” arXiv preprint arXiv:1312.6120, 2013.
 [33] T. Tieleman and G. Hinton, “Rmsprop: Divide the gradient by a running average of its recent magnitude. coursera: Neural networks for machine learning,” COURSERA Neural Networks Mach. Learn, 2012.
 [34] F. Pedregosa, G. Varoquaux, A. Gramfort, V. Michel, B. Thirion, O. Grisel, M. Blondel, P. Prettenhofer, R. Weiss, V. Dubourg et al., “Scikitlearn: Machine learning in python,” Journal of machine learning research, vol. 12, no. Oct, pp. 2825–2830, 2011.
 [35] M. Itoh and H. Satoh, “Geometric mean of probability measures and geodesics of fisher information metric,” arXiv preprint arXiv:1708.07211, 2017.
 [36] Y. LeCun, C. Cortes, and C. Burges, “Mnist handwritten digit database,” AT&T Labs [Online]. Available: http://yann. lecun. com/exdb/mnist, vol. 2, 2010.
 [37] A. Krizhevsky, V. Nair, and G. Hinton, “The cifar10 dataset,” online: http://www. cs. toronto. edu/kriz/cifar. html, 2014.