Decomposition of Uncertainty in Bayesian Deep Learning for Efficient and Risk-sensitive Learning

2017·Arxiv

Abstract

Abstract

Bayesian neural networks with latent variables are scalable and flexible probabilistic models: They account for uncertainty in the estimation of the network weights and, by making use of latent variables, can capture complex noise patterns in the data. We show how to extract and decompose uncertainty into epistemic and aleatoric components for decision-making purposes. This allows us to successfully identify informative points for active learning of functions with heteroscedastic and bimodal noise. Using the decomposition we further define a novel risk-sensitive criterion for reinforcement learning to identify policies that balance expected cost, model-bias and noise aversion.

1. Introduction

Many important problems in machine learning require learning functions in the presence of noise. For example, in reinforcement learning (RL), the transition dynamics of a system is often stochastic. Ideally, a model for these systems should be able to both express such randomness but also to account for the uncertainty in its parameters.

Bayesian neural networks (BNN) are probabilistic models that place the flexibility of neural networks in a Bayesian framework (Blundell et al., 2015; Gal, 2016). In particular, recent work has extended BNNs with latent input variables (BNN+LV) to estimate functions with complex stochasticity such as bimodality or heteroscedasticity (Depeweg et al., 2016). This model class can describe complex stochastic patterns via a distribution over the latent input variables (aleatoric uncertainty), while, at the same time, account for model uncertainty via a distribution over weights (epistemic uncertainty).

In this work we show how to perform and utilize a decomposition of uncertainty in aleatoric and epistemic components for decision making purposes. Our contributions are:

• We derive two decompositions that extract epistemic and aleatoric uncertainties from the predictive distribution of BNN+LV (Section 3).

• We demonstrate that with this uncertainty decomposition, the BNN+LV identifies informative regions even in bimodal and heteroscedastic cases, enabling effi-cient active learning in the presence of complex noise (Section 4).

• We derive a novel risk-sensitive criterion for model-based RL based on the uncertainty decomposition, enabling a domain expert to trade-off the risks of reliability, which originates from model bias and the risk induced by stochasticity (Section 5).

While using uncertainties over transition probabilities to avoid worst-case behavior has been well-studied in discrete MDPs (e.g. (Shapiro & Kleywegt, 2002; Nilim & El Ghaoui, 2005; Bagnell et al., 2001), to our knowledge, our work is the first to consider continuous non-linear functions with complex noise.

2. Background: BNN+LV

We review a recent family of probabilistic models for multioutput regression. These models were previously introduced by Depeweg et al. (2016), we refer to them as Bayesian Neural Networks with latent variables (BNN+LV).

Given a dataset , formed by feature vectors and targets , we assume that , where is the output of a neural network with weights W and K output units. The network receives as input the feature vector and the latent variable . We choose rec-tifiers, , as activation functions for the hidden layers and the identity function, , for the output layer. The network output is corrupted by the additive noise variable with diagonal covariance matrix . The role of the latent variable is to capture unobserved stochastic features that can affect the network’s output in complex ways. Without , randomness would only be given by the additive Gaussian observation noise , which can only describe limited stochastic patterns. The network has L layers, with hidden units in layer l, and is the collection of weight matrices. The +1 is introduced here to account for the additional per-layer biases. We approximate the exact posterior p(W, z | D) with:

The parameters and are determined by minimizing a divergence between p(W, z | D) and the approximation q. The reader is referred to the work of Hern´andez-Lobato et al. (2016); Depeweg et al. (2016) for more details on this. In our experiments, we tune q using black-box -divergence minimization with other values of are possible, this specific value produced better uncertainty decompositions in practice: see Section 4 and the supplementary material for results with and (variational Bayes).

BNN+LV can capture complex stochastic patterns, while at the same time account for model uncertainty. They achieve this by jointly learning q(z), which describes the values of the latent variables that were used to generate the training data, and q(W), which represents uncertainty about model parameters. The result is a flexible Bayesian approach for learning conditional distributions with complex stochasticity, e.g. bimodal or heteroscedastic noise.

3. Uncertainty Decomposition in BNN+LV

Let us assume that the targets are one-dimensional, that is, K = 1. The predictive distribution of a BNN+LV for the target variable associated with the test data point

where is the likelihood function, is the prior on the latent variables and q(W) is the approximate posterior for W given D. In this expression q(z) is not used since the integration with respect to must be done using the prior . The reason for this is that the associated with is unknown and consequently, there is no other evidence on than the one coming from

In Eq. (2), the randomness or uncertainty on has its origin in and . This means that there are two types of uncertainties entangled in our predictons for : aleatoric and epistemic (Der Kiureghian & Ditlevsen, 2009; Kendall & Gal, 2017). The aleatoric uncertainty originates from the randomness of cannot be reduced by collecting more data. By contrast, the epistemic uncertainty originates from the randomness of W and can be reduced by collecting more data, which will typically shrink the approximate posterior q(W).

Eq. (2) is the tool to use when making predictions for . However, there are many settings in which, for decision making purposes, we may be interested in separating the two forms of uncertainty present in this distribution. We now describe two decompositions , each one differing in the metric used to quantify uncertainty: the first one is based on the entropy, whereas the second one uses the variance.

Let Hcompute the differential entropy of a probability distribution. The total uncertainty present in Eq. (2) can then be quantified as H. Furthermore, assume that we do not integrate W out in Eq. (2) and, instead, we just condition on a specific value of this variable. The result is then with corresponding uncertainty H. The expectation of this quantity under q(W), that is, , can then be used to quantify the overall uncertainty in Eq. (2) coming from and . Therefore, , measures the aleatoric uncertainty. We can then quantify the epistemic part of the uncertainty in Eq. (2) by computing the difference between total and aleatoric uncertainties:

which is the mutual information between

Instead of the entropy, we can use the variance as a measure of uncertainty. Let compute the variance of a probability distribution. The total uncertainty present in Eq. (2) is then . This quantity can then be decomposed using the law of total variance:

where are, respectively, the mean and variance of according to . In the expression above, is the variance of when . This term ignores any contribution to the variance of from and and only considers the effect of W. Therefore, it corresponds to the epistemic uncertainty in Eq. (2). By contrast, the term represents the average value of when . This term ignores any contribution to the variance of and, therefore, it represents the aleatoric uncertainty in Eq. (2).

In some cases, working with variances can be undesirable because they have square units. To avoid this problem, we can work with the square root of the previous terms. For example, we can represent the total uncertainty using

4. Active Learning with Complex Noise

Active learning is the problem of iteratively collecting data so that the final gains in predictive performance are as high as possible (Settles, 2012). We consider the case of actively learning arbitrary non-linear functions with complex noise. To do so, we apply the information-theoretic framework for active learning described by MacKay (1992), which is based on the reduction of entropy in the model’s posterior distribution. Below, we show that this framework naturally results in the entropy-based uncertainty decomposition from Section 3. Next, we demonstrate how this framework, applied to BNN+LV enables data-efficient learning in the presence of heteroscedastic and bimodal noise.

Assume a BNN+LV is used to describe a batch of training data . The expected reduction in posterior entropy for W that would be obtained when collecting the unknown target for the input

Note that this is the epistemic uncertainty that we introduced in Section 3, which has arisen naturally in this setting: the most informative for which to collect next is the one for which the epistemic uncertainty in the BNN+LV predictive distribution is the highest.

The epistemic uncertainty in Eq. (5) can be approximated using standard entropy estimators, e.g. nearest-neighbor methods (Kozachenko & Leonenko, 1987; Kraskov et al., 2004; Gao et al., 2016). For that, we repeatedly sample W and and do forward passes through the BNN+LV to sample . The resulting samples of can then be used to approximate the respective entropies for each using the nearest-neighbor approach:

where is a nearest-neighbor entropy estimate given an empirical sample of points, are sampled from according to Eq. (2), and

There are alternative ways to estimate the entropy, e.g. with histograms or using kernel density estimation (KDE) (Beir- lant et al., 1997). We choose nearest neighbor methods because they tend to work well in low dimensions, are fast to compute (compared to KDE) and do not require much hyperparameter tuning (compared to histograms). However, we note that for high-dimensional problems, estimating entropy is a difficult problem.

4.1. Experiments

We evaluate the active learning procedure on three problems. In each of them, we first train a BNN+LV with 2 hidden layers and 20 units per layer. Afterwards, we approximate the epistemic uncertainty as outlined in the previous section. Hyper-parameter settings and details for replication can be found in the supplementary material, which includes results for three other inference methods: Hamiltonian Monte Carlo (HMC), black-box - divergence minimization with (variational Bayes). These results show that the decomposition of uncertainty produced by and the gold standard HMC are similar, but for lower values of this is not the case. Our main findings are:

The decomposition of uncertainty allows us to identify informative inputs when the noise is heteroscedastic. We consider a regression problem with heteroscedastic noise where with . We sample 750 values of the input x from a mixture of three Gaussians with mean parameters 4}, variance parameters and with each Gaussian component having weight equal to 1/3 in the mixture. Figure 1a shows the data. We have many points at the borders and in the center, but few in between.

Figure 1 shows the results obtained (see caption for details). The resulting decomposition of predictive uncertainty is very accurate: the epistemic uncertainty (Figure 1f), is inversely proportional to the density used to sample the data (Figure 1b). This makes sense, since in this toy problem the most informative inputs are located in regions where data is scarce. However, this may not be the case in more complicated settings. Finally, we note that the total predictive uncertainty (Figure 1d) fails to identify informative regions.

The decomposition of uncertainty allows us to identify informative inputs when the noise is bimodal. Next we consider a toy problem given by a regression task with bimodal data. We define with probability 0.5 and , otherwise, where and is independent of x. We sample 750 values of x from an exponential distribution with Figure 2a shows the data. We have many points on the left, but few on the right.

Figure 2 shows the results obtained (see caption for details). Figure 2c shows that the BNN+LV has learned the bimodal structure in the data and Figure 2d shows how the total predictive uncertainty increases on the right, where data is scarce. The aleatoric uncertainty (Figure 2e), by contrast,

Figure 1. Uncertainty decomposition on heteroscedastic data. (a): Raw data. (b): Density of x in data. (c): Predictive distribution (d): Estimate of H: Estimate of : Estimate of entropy reduction H

Figure 2. Uncertainty decomposition on bimodal data. (a): Raw data. (b): Density of x in data. (c): Predictive distribution: Estimate of H: Estimate of : Estimate of entropy reduction H

has an almost symmetric form around x = 0.75, taking lower values at this location. This makes sense since the data generating process is symmetric around x = 0.75 and the noise changes from bimodal to unimodal when one gets closer to x = 0.75. Figure 2f shows an estimate of the epistemic uncertainty, which as expected increases with x.

The decomposition of uncertainty identifies informative inputs when noise is both heteroscedastic and bimodal. We consider data sampled from a 2D stochastic system called the wet-chicken (Hans & Udluft, 2009; Depeweg et al., 2016), see the supplementary material for details. The wet-chicken transition dynamics exhibit complex stochastic patterns: bimodality, heteroscedasticity and truncation (the agent cannot move beyond the boundaries of state space: ). The data are 7, 500 state transitions collected by random exploration. Figure 3a shows the states visited. For each transition, the BNN+LV predicts the next state given the current one and the action applied. Figure 3d shows that the epistemic uncertainty is highest in the top right corner,

Table 1. Test log-likelihood in active learning experiments after 150 iterations.

while data is most scarce in the bottom right corner. The reason for this result is that the wet-chicken dynamics bring the agent back to y = 0 whenever the agent goes beyond y = 5, but this does not happen for y = 0 where the agent just bounces back. Therefore, learning the dynamics is more difficult and requires more data at y = 5 than at y = 0. The epistemic uncertainty captures this property, but the total predictive uncertainty (Figure 3b) does not.

Active learning with BBN+LV is improved by using the uncertainty decomposition. We evaluate the gains obtained by using Eq. (5) with BNN+LV, when collecting

Figure 3. Uncertainty decomposition on wet-chicken dynamics. (a): Raw data. (b): Entropy estimate Hof predictive distribution for each : Conditional entropy estimate : Estimated entropy reduction.

data in three toy active learning problems. We refer to this method as and compare it with two baselines. The first one also uses a BNN+LV to describe data, but does not perform a decomposition of predictive uncertainty, that is, this method uses Hinstead of Eq. (5) for active learning. We call this method Hbb-. The second baseline is given by a Gaussian process (GP) model which collects data according to Hsince in this case the uncertainty decomposition is not necessary because the GP model does not include latent variables. The GP model assumes Gaussian noise and is not able to capture complex stochastic patterns.

The three problems considered correspond to the datasets from Figures 1, 2 and 3. The general set-up is as follows. We start with the available data shown in the previous figures. At each iteration, we select a batch of data points to label from a pool set which is sampled uniformly at random in input space. The selected data is then included in the training set and the log-likelihood is evaluated on a separate test set. This process is performed for 150 iterations and we repeat all experiments 5 times.

Table 1 shows the results obtained. Overall, BNN+LV outperform GPs in terms of predictive performance. We also see significant gains of heteroscedastic and wet-chicken tasks, whereas their results are similar on the bimodal task. The reason for this is that, in the latter task, the epistemic and the total uncertainty have a similar behaviour as shown in Figures 2d and 2f. Finally, we note that heteroscedastic GPs (Le et al., 2005) will likely perform similar to BNN+LV in the heteroscedastic task from Figure 2, but they will fail in the other two settings considered (Figures 2 and 3).

5. Risk-sensitive Reinforcement Learning

We propose an extension of the “risk-sensitive criterion” for safe model-based RL (Garc´ıa & Fern´andez, 2015) to balance the risks produced by epistemic and aleatoric uncertainties.

We focus on batch RL with continuous state and action spaces (Lange et al., 2012): we are given a batch of state transitions formed by triples contain- ing the current state , the action applied and the next state . In addition to D, we are also given a cost function c. The goal is to obtain from D a policy in parametric form that minimizes c on average under the system dynamics.

In model-based RL, the first step consists in learning a dynamics model from D. We assume that the true dynamical system can be expressed by an unknown neural network with latent variables:

where denotes the weights of the network and , are the inputs to the network. We use BNN+LV from Section 2 to approximate a posterior q(W, z) using the batch D (Depeweg et al., 2016).

In model-based policy search we optimize a policy given by a deterministic neural network with weights . This parametric policy returns an action as a function of , that is, . The policy parameters can be tuned by minimizing the expectation of the cost C = over a finite horizon T with respect to the belief . This expected cost is obtained by averaging across multiple virtual roll-outs as described next.

Given , we sample and simulate state trajectories for T steps using the model with policy , input noise and additive noise . By averaging across these roll-outs, we obtain a Monte Carlo approximation of the expected cost given the initial state

where, denotes here an average across virtual roll-outs starting from and, to simplify our notation, we have made the dependence on implicit. The policy search algorithm optimizes the expectation of Eq. (8) when is sampled uniformly from D, that is, . This quantity can be easily approximated by Monte Carlo and if model, policy, and cost function are differentiable, we are able to tune by stochastic gradient descent.

The “risk-sensitive criterion” (Garc´ıa & Fern´andez, 2015) changes Eq. (8) to atain a balance between expected cost and risk, where the risk typically penalizes the deviations of C from E[C] during the virtual roll-outs with initial state . For example, the risk-sensitive objective could be

where is the standard deviation of C across virtual roll-outs starting from and the risk-sensitive parameter determines the amount of risk-avoidance (seeking behavior () when optimizing

Instead of working directly with the risk on the final cost C, we consider the sum of risks on the individual costs . The reason for this is that the latter is a more restrictive criterion since low risk on the will imply low risk on C, but not the other way around. Let denote the standard deviation of over virtual roll-outs starting from . We can then explicitly write in terms of its aleatoric and epistemic components by using the decomposition of uncertainty from Eq. (4). In particular,

where denote the mean and variance of under virtual roll-outs from performed with policy and under the dynamics of a BNN+LV with parameters W. In a similar manner as in Eq. (4), the operators and ) compute the mean and variance of their arguments when

The two terms inside the square root in Eq. (10) have a clear interpretation. The first one, , represents the risk originating from the sampling of z and in the virtual roll-outs. We call this term the aleatoric risk. The second term, , encodes the risk originating from the sampling of W in the virtual roll-outs. We call this term the epistemic risk.

We can now extend the objective in Eq. (8) with a new risk term that balances the epistemic and aleatoric risks. This term is obtained by first using risk-sensitive parameters and to balance the epistemic and aleatoric components in Eq. (10), and then summing the resulting expression for t = 1, . . . , T:

σ

Therefore, our ‘risk-sensitive criterion” uses the function , which can be approximated via Monte Carlo and optimized using stochastic gradient descent. The Monte Carlo approximation is generated by performing roll-outs with starting state uniformly from D. For this, W is sampled from q(W) a total of M times and then, for each of these samples, N roll-outs are performed with W fixed and sampling only the latent variables and the additive Gaussian noise in the BBN+LV. Let and be the samples of the latent variables and the additive Gaussian noise at step t during the n-th roll-out for the m-th sample of W, which we denote by Then denotes the cost obtained at time t in that roll-out. All these cost values obtained at time t are stored in the matrix C(t). The Monte Carlo estimate of

where 1 denotes a vector with all of its entries equal to 1, is a vector with the m-th row of C(t) and returns the empirical variance of the entries in vector x.

By setting to specific values in Eq. (11), the user can choose different trade-offs between cost, aleatoric and epistemic risk: for the term inside the square root is times which is a Monte Carlo approximation of the epistemic risk in Eq. (10). Similarly, for the square root we obtain times which approximates the aleatoric risk. For the standard risk criterion is obtained, weighted by

5.1. Model-bias and Noise aversion

The epistemic risk term in Eq. (10) can be connected with the concept of model-bias in model-based RL. A policy with is optimized on the model but executed on the ground truth system. The more model and ground truth differ, the more the policy is ’biased’ by the model (Deisenroth & Ras- mussen, 2011). Given the initial state , we can quantify this bias with respect to the policy parameters

where is the expected cost obtained at time t across roll-outs starting at , under the ground truth dynamics and with policy is the same expectation but under BNN+LV dynamics sampled from q(W) on each individual roll-out.

Eq. (12) is impossible to compute in practice because we do not know the ground truth dynamics. However, as indicated in Eq. (7), we assume that the true dynamic is given by a neural network with latent variables and weights can then rewrite and since we do not know , we can further assume that expected model-bias is then

We see that our definition of epistemic risk also represents an estimate of model-bias in model-based RL. This risk term will guide the policy to operate in areas of state space where model-bias is expected to be low.

The aleatoric risk term in Eq. (10) can be connected with the concept of noise aversion. Let be the variance obtained at time t across roll-outs starting at , under the ground truth dynamics and with policy . Assuming , the expected variance is then . This term will guide the policy to operate in areas of state space where the stochasticity of the cost is low. Assuming a deterministic cost function this stochasticity is determined by the model’s predictions that originate from

5.2. Experiments

We investigate the following questions: To what extent does our new risk criterion reduce model-bias? What trade-offs do we observe between average cost and model-bias? How does the decomposition compare to other simple methods?

We consider two model-based RL scenarios. The first one is given by the industrial benchmark (IB), a publicly available simulator with properties inspired by real industrial systems (Hein et al., 2017). The second RL scenario is a modified version of the HAWC2 wind turbine simulator (Larsen & Hansen, 2007), which is widely used for the study of wind turbine dynamics (Larsen et al., 2015).

We are given a batch of data formed by state transitions generated by a behavior policy , for example, from an already running system. The behavioral policy has limited randomness and will keep the system dynamics constrained to a reduced manifold in state space. This means that large portions of state space will be unexplored and uncertainty will be high in those regions. The supplementary material contains full details on the experimental setup and the

We consider the risk-sensitive criterion from Section 5 for different choices of , comparing it with 3 baselines. The first baseline is obtained by setting . In this case, the policy optimization ignores any risk. The second baseline is obtained when . In this case, the risk criterion simplifies to , which corresponds to the traditional risk-sensitive approach in Eq. (9), but applied to the individual costs . The last baseline uses a deterministic neural network to model the dynamics and a nearest neighbor approach to quantify risk: for each state generated in a roll-out, we calculate the Euclidean distance of that state to the nearest one in the training data. The average value of the distance metric for across roll-outs is then an approximation to . To reduce computational cost, we summarize the training data using the centroids returned by an execution of the k-means clustering method. We denote this method as the nn-baseline.

Figure 4a shows result on the industrial benchmark. The y-axis in the plot is the average total cost at horizon T obtained by the policy in the ground truth system. The x-axis is the average model-bias in the ground truth system according to Eq. (12). Each individual curve in the plot is obtained by fixing to a specific value (line colour) and then changing (circle colour). The policy that ignores risk () results in both high model-bias and high cost when evaluated on the ground truth, which indicates overfitting. As increases, the policies put more emphasis on avoiding model-bias, but at the same time the average cost increases. The best tradeoff is obtained by the dark red curve with . The risk criterion is then . In this problem, adding aleatoric risk by setting decreases performance. The nn-baseline shows a similar pattern as the BNN+LV approach, but the trade-off between model-bias and cost is worse.

Figure 5 shows roll-outs for three different policies and a fixed initial state . Figure 5a shows results for a policy learned with . This policy ignores risk, and as a consequence, the mismatch between predicted performance on the model and on the ground truth increases after t = 20. This result illustrates how model-bias can lead to policies with high costs at test time. Figure 5b shows results for policy that was trained while penalizing epistemic risk (). In this case, the average costs under the BNN+LV model and the ground truth are similar, and the overall ground truth cost is lower than in Figure 5a. Finally, Figure 5c shows results for a noise averse policy (). In this case, the model bias is slightly higher than in the previous figure, but the stochasticity is lower.

The results for wind turbine simulator can be found in Figure 4b. In this case, the best trade-offs between expected cost and model-bias are obtained by the policies with . These policies are noise averse and will try to avoid noisy regions in state space. This makes sense because in wind turbines, high noise regions in state space are those where the effect of wind turbulence will have a strong impact on the average cost.

6. Related Work

The distinction between aleatoric and epistemic uncertainty has been recognized in many fields within machine learning, often within the context of specific subfields, models, and objectives. Kendall & Gal (2017) consider a decomposition of uncertainty in the context of computer vision with heteroscedastic Gaussian output noise, while McAllister (2016) consider a decomposition in GPs for model-based RL.

Figure 4. RL experiments. (a): results on industrial benchmark. (b): results on wind turbine simulator. Each curve shows average cost (y-axis) against model-bias (x-axis). Circle color corresponds to different values of (epistemic risk weight) and curve color indicates different values of (aleatoric risk weight). The purple curve is the baseline . The black curve is nearest neighbor baseline.

Figure 5. 100 roll-outs on the industrial benchmark ground truth system (light green), their average cost (dark green), and the average cost of corresponding roll-outs on the BNN+LV model (blue) for a fixed value of the initial state . We show results for three policies with different epistemic and aleatoric risk trade-offs. Policies are optimized using (a): no risk penalty (: a penalty on the epistemic risk only (: a penalty on the aleatoric risk only (

Within reinforcement learning, Bayesian notions of model uncertainty have a long history (Schmidhuber, 1991b;a; Dearden et al., 1999; Still & Precup, 2012; Sun et al., 2011; Maddison et al., 2017). The mentioned works typically consider the online case, where model uncertainty (a.k.a. curiosity) is used to guide exploration, e.g. in Houthooft et al. (2016) the uncertainty of a BNN model is used to guide exploration assuming deterministic dynamics. In contrast, we focus on the batch setting with stochastic dynamics.

Model uncertainty is used in safe or risk-sensitive RL (Mi- hatsch & Neuneier, 2002; Garc´ıa & Fern´andez, 2015). In safe RL numerous other approaches exists for safe exploration (Joseph et al., 2013; Hans et al., 2008; Garcia & Fern´andez, 2012; Berkenkamp et al., 2017). Uncertainties over transition probabilities have been studied in discrete MDPs since a long time (Shapiro & Kleywegt, 2002; Nilim & El Ghaoui, 2005; Bagnell et al., 2001) often with a focus on worst-case avoidance. Our work extends this to continuous state and action space using scalable probabilistic models. Our decomposition enables a practitioner to adjust the optimization criterion to specific decision making,.

Within active learning many approaches exist that follow an information theoretic approach (MacKay, 1992; Hern´andez- Lobato & Adams, 2015; Guo & Greiner, 2007). To our knowledge, all of these approaches however use deterministic methods (mostly GPs) as model class. Perhaps closest to our work is BALD (Houlsby et al., 2012), however because GPs are used, this approach cannot model problems with complex noise.

7. Conclusion

We have described a decomposition of predictive uncertainty into its epistemic and aleatoric components when working with Bayesian neural networks with latent variables. We have shown how this decomposition of uncertainty can be used for active learning, where it naturally arises from an information-theoretic perspective. We have also used the decomposition to propose a novel risk- sensitive criterion for model-based reinforcement learning which decomposes risk into model-bias and noise aversion components. Our experiments illustrate how the described decomposition of uncertainty is useful for efficient and risk-sensitive learning.

References

Bagnell, J. A., Ng, A. Y., and Schneider, J. G. Solving uncertain markov decision processes. 2001.

Beirlant, J., Dudewicz, E. J., Gy¨orfi, L., and Van der Meulen, E. C. Nonparametric entropy estimation: An overview. International Journal of Mathematical and Statistical Sciences, 6(1):17–39, 1997.

Berkenkamp, F., Turchetta, M., Schoellig, A. P., and Krause, A. Safe model-based reinforcement learning with stability guarantees. In Advances in Neural Information Processing Systems (NIPS), pp. 908–918, 2017.

Blundell, C., Cornebise, J., Kavukcuoglu, K., and Wierstra, D. Weight uncertainty in neural networks. In International Conference on Machine Learning (ICML), pp. 1613–1622, 2015.

Dearden, R., Friedman, N., and Andre, D. Model based bayesian exploration. In Proceedings of the Fifteenth conference on Uncertainty in artificial intelligence (UAI), pp. 150–159, 1999.

Deisenroth, M. and Rasmussen, C. E. Pilco: A model-based and data-efficient approach to policy search. In Proceedings of the 28th International Conference on machine learning (ICML-11), pp. 465–472, 2011.

Depeweg, S., Hern´andez-Lobato, J. M., Doshi-Velez, F., and Udluft, S. Learning and policy search in stochastic dynamical systems with bayesian neural networks. International Conference on Learning Representations (ICLR), 2016.

Der Kiureghian, A. and Ditlevsen, O. Aleatory or epistemic? does it matter? Structural Safety, 31(2):105–112, 2009.

Gal, Y. Uncertainty in deep learning. PhD thesis, University of Cambridge, 2016.

Gao, W., Oh, S., and Viswanath, P. Breaking the bandwidth barrier: Geometrical adaptive entropy estimation. In Advances in Neural Information Processing Systems (NIPS), pp. 2460–2468, 2016.

Garcia, J. and Fern´andez, F. Safe exploration of state and action spaces in reinforcement learning. Journal of Artificial Intelligence Research, 45:515–564, 2012.

Garc´ıa, J. and Fern´andez, F. A comprehensive survey on safe reinforcement learning. The Journal of Machine Learning Research, 16(1):1437–1480, 2015.

Guo, Y. and Greiner, R. Optimistic active-learning using mutual information. In International Joint Conference on Artificial Intelligence (IJCAI), pp. 823–829, 2007.

Hans, A. and Udluft, S. Efficient uncertainty propagation for rein- forcement learning with limited data. In International Conference on Artificial Neural Networks (ICANN), pp. 70–79. 2009.

Hans, A., Schneegaß, D., Sch¨afer, A. M., and Udluft, S. Safe exploration for reinforcement learning. In ESANN, pp. 143– 148, 2008.

Hein, D., Depeweg, S., Tokic, M., Udluft, S., Hentschel, A., Runk- ler, T. A., and Sterzing, V. A benchmark environment motivated by industrial control problems. IEEE Symposium on Computational Intelligence (IEEE SSCI), 2017.

Hern´andez-Lobato, J. M. and Adams, R. Probabilistic backpropagation for scalable learning of bayesian neural networks. In International Conference on Machine Learning (ICML), pp. 1861–1869, 2015.

Hern´andez-Lobato, J. M., Li, Y., Rowland, M., Hern´andez-Lobato, D., Bui, T., and Turner, R. E. Black-box -divergence minimization. In International Conference on Machine Learning (ICML), pp. 1861–1869, 2016.

Houlsby, N., Huszar, F., Ghahramani, Z., and Hern´andez-Lobato, J. M. Collaborative gaussian processes for preference learning. In Advances in Neural Information Processing Systems (NIPS), pp. 2096–2104, 2012.

Houthooft, R., Chen, X., Duan, Y., Schulman, J., De Turck, F., and Abbeel, P. VIME: Variational information maximizing exploration. In Advances in Neural Information Processing Systems (NIPS), pp. 1109–1117, 2016.

Joseph, J., Geramifard, A., Roberts, J. W., How, J. P., and Roy, N. Reinforcement learning with misspecified model classes. In International Conference on Robotics and Automation (ICRA), pp. 939–946, 2013.

Kendall, A. and Gal, Y. What uncertainties do we need in bayesian deep learning for computer vision? In Advances in Neural Information Processing Systems (NIPS), pp. 5580–5590, 2017.

Kozachenko, L. and Leonenko, N. N. Sample estimate of the entropy of a random vector. Problemy Peredachi Informatsii, 23(2):9–16, 1987.

Kraskov, A., St¨ogbauer, H., and Grassberger, P. Estimating mutual information. Physical review E, 69(6):066138, 2004.

Lange, S., Gabel, T., and Riedmiller, M. Batch reinforcement learning. In Reinforcement learning, pp. 45–73. Springer, 2012.

Larsen, T. J. and Hansen, A. M. How 2 hawc2, the user’s manual. Technical report, Risø National Laboratory, 2007.

Larsen, T. J., Larsen, G., Madsen, H. A., Thomsen, K., and Ped- ersen, S. M. Comparison of measured and simulated loads for the siemens swt2.3 operating in wake conditions at the lillgrund wind farm using hawc2 and the dynamic wake meander model. EWEA offshore 2015, 2015.

Le, Q. V., Smola, A. J., and Canu, S. Heteroscedastic gaussian process regression. In International Conference on Machine Learning (ICML), pp. 489–496, 2005.

MacKay, D. J. Information-based objective functions for active data selection. Neural computation, 4(4):590–604, 1992.

Maddison, C. J., Lawson, D., Tucker, G., Heess, N., Doucet, A., Mnih, A., and Teh, Y. W. Particle value functions. arXiv preprint arXiv:1703.05820, 2017.

McAllister, R. Bayesian Learning for Data-Efficient Control. PhD thesis, Kings College, 2016.

Mihatsch, O. and Neuneier, R. Risk-sensitive reinforcement learn- ing. Machine learning, 49(2-3):267–290, 2002.

Nilim, A. and El Ghaoui, L. Robust control of markov decision pro- cesses with uncertain transition matrices. Operations Research, 53(5):780–798, 2005.

Schmidhuber, J. Curious model-building control systems. In IEEE International Joint Conference on Neural Networks, pp. 1458–1463, 1991a.

Schmidhuber, J. A possibility for implementing curiosity and boredom in model-building neural controllers. In From animals to animats: Proceedings of the first international conference on simulation of adaptive behavior, pp. 15–21. Citeseer, 1991b.

Settles, B. Active learning. Synthesis Lectures on Artificial Intelligence and Machine Learning, 6(1):1–114, 2012.

Shapiro, A. and Kleywegt, A. Minimax analysis of stochastic problems. Optimization Methods and Software, 17(3):523–542, 2002.

Still, S. and Precup, D. An information-theoretic approach to curiosity-driven reinforcement learning. Theory in Biosciences, pp. 139–148, 2012.

Sun, Y., Gomez, F., and Schmidhuber, J. Planning to be surprised: Optimal bayesian exploration in dynamic environments. In International Conference on Artificial General Intelligence, pp. 41–51, 2011.

A. Hamiltonian Monte Carlo Solution to Toy Problems

The goal here is to show that the decomposition we obtained in the active learning examples is not a result of our approximation using black-box -divergence minimization but a property of BNN+LV themselves. To that end we will approximate using HMC. After a burn-in of 500, 000 samples we sample from the posterior 200, 000 samples. We thin out 90% by only keeping every tenth sample.

A.1. Heteroscedastic Problem

We define the stochastic function with . The data availability is limited to specific regions of x. In particular, we sample 750 values of x from a mixture of three Gaussians with mean parameters , variance parameters and with each Gaussian component having weight equal to 1/3 in the mixture. Figure 6a shows the raw data. We have lots of points at both borders of the x axis and in the center, but little data available in between.

Figure 6. HMC results of active learning example using heteroscedastic data. (a): Raw data. (b): Density of x in raw data. (c): Predictive distribution: p(y|x) of BNN using HMC. (d): Entropy estimate H(y|x) of predictive distribution for each x. (e): Conditional Entropy estimate of predictive distribution for each x. (f): Estimate of reduction in entropy for each x.

A.2. Bimodal Problem

We consider a toy problem given by a regression task with bimodal data. We define and with probability , otherwise, where is independent of x. The data availability is not uniform in x. In particular we sample 750 values of x from an exponential distribution with

Figure 7. HMC results of active learning example using bimodal data. (a): Raw data. (b): Density of x in raw data. (c): Predictive distribution: p(y|x) of BNN using Hamilton monte carlo. (d): Entropy estimate H(y|x) of predictive distribution for each x. (e): Conditional Entropy estimate of predictive distribution for each x. (f): Estimate of reduction in entropy for each x.

B. Solutions to Toy Problems for different values of α

In the main document we pointed out that the decomposition of uncertainty does not work as good with other values of . We will see in the following, that lower values of will put more and more emphasis on the latent variable z. We observe that the epistemic uncertainty will vanish as the -divergence minimization approaches variational Bayes.

Figure 8. Active learning example using heteroscedastic data using a BNN optimized with bb-: Raw data. (b): Density of x in raw data. (c): Predictive distribution: p(y|x) of BNN. (d): Entropy estimate H(y|x) of predictive distribution for each x. (e): Conditional Entropy estimate of predictive distribution for each x. (f): Estimate of reduction in entropy for each x.

Figure 9. Active learning example using bimodal data using a BNN optimized with bb-: Raw data. (b): Density of x in raw data. (c): Predictive distribution: p(y|x) of BNN. (d): Entropy estimate H(y|x) of predictive distribution for each x. (e): Conditional Entropy estimate of predictive distribution for each x. (f): Estimate of reduction in entropy for each x.

B.2. V B solutions to Toy Problems

We approximate the method variational Bayes by setting

Figure 10. Active learning example using heteroscedastic data using a BNN optimized by variational Bayes. (a): Raw data. (b): Density of x in raw data. (c): Predictive distribution: p(y|x) of BNN. (d): Entropy estimate H(y|x) of predictive distribution for each x. (e): Conditional Entropy estimate of predictive distribution for each x. (f): Estimate of reduction in entropy for each x.

C. Experiments Speciﬁcation

C.1. Active Learning

All models start with the available described in the respective paragraphs. We train for 5000 epochs a BNN+LV with two-hidden layer and 20 hidden units per layer. We use Adam as optimizer with a learning rate of 0.001. For Gaussian

Figure 11. Active learning example using bimodal data using a BNN optimized by variational Bayes. (a): Raw data. (b): Density of x in raw data. (c): Predictive distribution: p(y|x) of BNN. (d): Entropy estimate H(y|x) of predictive distribution for each x. (e): Conditional Entropy estimate of predictive distribution for each x. (f): Estimate of reduction in entropy for each x.

processes(GPs) we use the standard RBF kernel using the python GPy implementation. For the entropy estimation we use a nearest-neighbor approach as explained in the main document with k = 25 and 500 samples of q(W) and 500 samples of p(z).

For active learning we evaluate performance using a held-out test set of size 500 for the bimodal and heteroscedastic problem and 2500 for the wet-chicken problem. The test data is sampled uniformly in state (and action) space. In each of the n = 150 iterations we sample a pool set of size 50 uniformly in input space. In each iteration a method can decide to include 5 data points into the training set. After that, the models are re-trained (from scratch) and the performance is evaluated on the test set.

C.2. Wet-chicken

We use the continuous two-dimensional version of the problem. A canoeist is paddling on a two-dimensional river. The canoeist’s position at time t is . The river has width w = 5 and length l = 5 with a waterfall at the end, that is, at . The canoeist wants to move as close to the waterfall as possible because at time t he gets reward . However, going beyond the waterfall boundary makes the canoeist fall down, having to start back again at the origin (0, 0). At time t the canoeist can choose an action that represents the direction and magnitude of his paddling. The river dynamics have stochastic turbulences and drift that depend on the canoeist’s position on the x axis. The larger , the larger the drift and the smaller , the larger the turbulences.

The underlying dynamics are given by the following system of equations. The drift and the turbulence magnitude are given by and , respectively. The new location is given by the current location and current action

where is a random variable that represents the current turbulence. As the canoeist moves closer to the waterfall, the distribution for the next state becomes increasingly bi-modal because when he is close to the waterfall, the change in the current location can be large if the canoeist falls down the waterfall and starts again at (0, 0). The distribution may also be truncated uniform for states close to the borders. Furthermore the system

has heteroscedastic noise, the smaller the value of the higher the noise variance.

C.3. Reinforcement Learning

Policies in the industrial benchmark specify changes in three steering variables v (velocity), g (gain) and s (shift) as a function of . In the behavior policy these changes are stochastic and sampled according to

where and . The velocity v(t) and gain g(t) can take values in [0, 100]. Therefore, the data collection policy will try to keep these values only in the medium range given by the interval [40, 60]. Because of this, large parts of the state space will be unobserved. After collecting the data, the 30, 000 state transitions are used to train a BNN with latent variables with the same hyperparameters as in (Depeweg et al., 2016). Finally, we train different policies using the Monte Carlo approximation and we set the horizon of T = 100 steps, with M = 50 and N = 25 and a minibatch size of 1 for 750 epochs. The total training time on a single CPU is around 18 hours.

In this problem we observe the turbine state s(t), with features such as current wind speed and currently produced power. Our actions a(t) adjust the turbine’s behavior, with known upper and lower bounds. The goal is to maximize energy output over a T-step horizon.

We are given a batch of around 5,000 state transitions generated by a behavior policy . The policy does limited exploration around the neutral action a(t) = 0.

The system is expected to be highly stochastic due to the unpredictability of future wind dynamics. Furthermore the dimensionality of state observation is much higher than the action dimensionality, so, with the limited dataset that we have, we expect it to be very challenging to accurately learn the influence of the action on the reward.

First we train a BNN with two hidden layer and 50 hidden units per layer on the available batch using -divergence minimization with . In the second step, using the model, we train a policy with 20 hidden units on each of the two layers in the usual way, using the Monte Carlo estimate. The total training time on a single CPU is around 8 hours.

designed for accessibility and to further open science