Deep Ensembles: A Loss Landscape Perspective (Paper Explained)
deep learning machine learning arxiv explained neural networks ai artificial intelligence paper ensembles bayesian modes loss function nonconvex google deepmind stan fort foundational weight space labels agreement minima loss landscape trajectory local minima optimization
#ai #research #optimization

Deep Ensembles work surprisingly well for improving the generalization capabilities of deep neural networks. Surprisingly, they outperform Bayesian Networks, which are - in theory - doing the same thing. This paper investigates how Deep Ensembles are especially suited to capturing the non-convex loss landscape of neural networks.

OUTLINE:
0:00 - Intro & Overview
2:05 - Deep Ensembles
4:15 - The Solution Space of Deep Networks
7:30 - Bayesian Models
9:00 - The Ensemble Effect
10:25 - Experiment Setup
11:30 - Solution Equality While Training
19:40 - Tracking Multiple Trajectories
21:20 - Similarity of Independent Solutions
24:10 - Comparison to Baselines
30:10 - Weight Space Cross-Sections
35:55 - Diversity vs Accuracy
41:00 - Comparing Ensembling Methods
44:55 - Conclusion & Comments

Paper: https://arxiv.org/abs/1912.02757

Abstract:
Deep ensembles have been empirically shown to be a promising approach for improving accuracy, uncertainty and out-of-distribution robustness of deep learning models. While deep ensembles were theoretically motivated by the bootstrap, non-bootstrap ensembles trained with just random initialization also perform well in practice, which suggests that there could be other explanations for why deep ensembles work well. Bayesian neural networks, which learn distributions over the parameters of the network, are theoretically well-motivated by Bayesian principles, but do not perform as well as deep ensembles in practice, particularly under dataset shift. One possible explanation for this gap between theory and practice is that popular scalable variational Bayesian methods tend to focus on a single mode, whereas deep ensembles tend to explore diverse modes in function space. We investigate this hypothesis by building on recent work on understanding the loss landscape of neural networks and adding our own exploration to measure the similarity of functions in the space of predictions. Our results show that random initializations explore entirely different modes, while functions along an optimization trajectory or sampled from the subspace thereof cluster within a single mode predictions-wise, while often deviating significantly in the weight space. Developing the concept of the diversity--accuracy plane, we show that the decorrelation power of random initializations is unmatched by popular subspace sampling methods. Finally, we evaluate the relative effects of ensembling, subspace based methods and ensembles of subspace based methods, and the experimental results validate our hypothesis.

Authors: Stanislav Fort, Huiyi Hu, Balaji Lakshminarayanan

Links:
YouTube: https://www.youtube.com/c/yannickilcher
Twitter: https://twitter.com/ykilcher
Discord: https://discord.gg/4H8xxDF
BitChute: https://www.bitchute.com/channel/yannic-kilcher
Minds: https://www.minds.com/ykilcher
 Hi there! Today we'll look at Deep Ensembles, a lost landscape perspective by Stanislav Fort, Hui Yi Hu and Balaji Lakshminarayanan. This paper on a high level explains the lost landscape of deep ensemble models, so ensembles of deep neural network. And it hypothesizes, and it shows through experiments, that each member of the ensemble, by means of being initialized at a random point, will go and, through optimization, go and end up at a different place in weight space. And therefore the deep ensemble is able to capture different modes of the functional space, of the space of solutions. They compare this to Bayesian networks, which are sort of promised to do the same thing, but they often only characterize a single mode, and therefore they don't generalize as well. So join me exploring this paper, I think it's a pretty cool paper. The experiments are cleverly designed to show what they're supposed to show, and I generally enjoy this type of research because it's kind of an explanatory research that shows you what's going on inside of these networks, rather than, you know, chasing the next state-of-the-art number. It's also an example of research that you can still do while you don't have, you know, giant resources of compute, even though this is by DeepMind. But I do believe that this kind of research is still, you know, wide open and available to academia, and whereas the other kind, the state-of-the-art kind, slowly goes into more and more of the money game. All right, in any case, join me in reading this paper. If you like it, share it out, leave a comment to tell me what you think, and leave a like if you enjoyed it. All right, so we'll start off. The abstract says, deep ensembles have been empirically shown to be a promising approach for improving accuracy, uncertainty, and out-of-distribution robustness of deep learning models. So what are deep ensembles? Really quick, an ensemble model, and we're in the classification setting. So in the classification setting, we have data points, and each data point has features, so which are the x, x is some kind of d-dimensional feature, and then you have y, which is the label. So that's in some, let's say that's some natural number or something like this, or is element of a class set. Now that's the complex numbers. It's element of some bounded set of class labels, so it's either a cat or a dog or you know, whatever you want. So you have a data set of these things, and your plan is to use x to predict y. If you build a model, a deep neural network, for example, for this task, you would simply characterize this function here, you would parameterize it as a deep neural network of many, many layers. If you build an ensemble now, what you would do is you would take the data set and simply train multiple different ones of these deep neural networks. So you'll train multiple different ones. And if you now want to classify data point, you'll input that data point into all of these three. And at the end, you would somehow aggregate, and there are different methods of doing this, but the most obvious one is simply either to aggregate by the mean or the mode, median, whatever you want, you could also kind of also learn something here. But you can just average the predictions. And that will usually give you a better prediction than if you only have one model. So this is called an ensemble model. And if the ensemble members, these things here are neural networks or deep networks, this is called a deep ensemble. So why do we hope to become better? That's the point of this paper is to show what happens in the lost landscape of these deep neural networks. And why do they perform better than other methods that are supposed to achieve the same thing. So usually, when you build an ensemble model, what are you hoping for? You're hoping to sort of learn a generalizable function. And they have this drawing right here, where it's a bit of a you have to sort of think differently than you usually do. So on the x axis, you have the space of solutions. So imagine that your, your neural network only has a single weight. So this axis here is that single weight, or you can project or or whatnot, this is the space of different solutions. So after you optimize, you land somewhere on this axis. And you can see that there is a solid line which represents the accuracy on the training set. And then there is a dashed line which represents the accuracy of the validation set for a given parameter. So what you usually do is you optimize one neural network to its very best training accuracy. So let's say you start off here, what you would do is you would see my training accuracy is this high, I need a different color right here is this high. And you calculate the gradient, and you could do gradient descent. And that means you go down the loss up the accuracy. So you go over and over and over until you reach this point right here, where you have maximum training accuracy, and then you'll suffer some generalization loss like you're gonna see right here, it's all for some generalization loss, because the validation accuracy at that point isn't as high. But generally, it's correlated, as you can see, by the general overlap of these two lines of these two shapes right here. Okay, so this is called a maximum a posteriori estimate, you simply optimize one neural network until the best training error. There are different approaches right here, there are approaches that say, okay, we can do we could do better. So first of all, what you see right here is rather peculiar. And you might not be used to this, that there are different peaks right here, there are different peaks, as you can see in the training and the validation error. So they're correlated. And the idea is that neural networks are very nonlinear. And we've known from other papers that they have many, many local minima. And in fact, so this is one of the astounding things about neural network, most of these minima are performing equally well. So even though the neural network has different local minima, they all perform about equally well. And other papers even say they're all sort of connected on a low loss landscape. So there are many, many things that are still mysterious about neural network. But we know that there are multiple minima. And we know that we basically need to find one of them. And it doesn't really matter which one they all perform sort of equally well. Now, as you can, as you might imagine, there are people who aren't really satisfied with this. And there are approaches to say, why don't we just capture this entire curve right here. So if we could build a model that could not only tell us at this point right here, you're this good, but could tell us that at any point, how good we are captured the entire distribution of solutions. And these are usually in the category of the Bayesian neural networks, they try to capture the entire distribution. Of course, that's not really feasible, because you always have to calculate that posterior. So what they end up doing is they do some approximation. And usually they do some sort of a multivariate Gaussian approximation, because you can calculate posteriors in closed form and so on. And this paper, this paper's hypothesis is that these can only usually capture one of these peaks. So they are very able to capture the surrounding right here, they're, they can capture very accurately what happens around this particular peak. They are very aware of the shape of the curvature here, and can tell you a lot of things about it. So they can tell you, for example, that the validation so that you might want to be a bit over here, rather than over here. But they cannot they don't generally know about these other modes, because they are only approximations. They generally don't produce multimodal solutions. Another approach is a deep ensemble. Now, this paper shows that in general, if you train a deep ensemble, what will happen is because you randomly initialize the deep ensemble, at some points, it will happen that if you do gradient descent on all of them, they will end up sort of covering all these different modes, they still they don't have an idea of you know, the curvature, sorry, this one shouldn't go here, this one should go here, the curve, they don't really know about the curvature, but they will give you these different minima right here. And therefore, they can capture the landscape much, much more easily. If you know that these three are minima, you sort of, it might look something like this. And that's a hell of a lot better than simply the Bayesian approximation that you have to capture one of the peaks, but really accurately. So, their hypothesis here is that deep ensembles do this job of capturing the different modes of the functional space much better than the Bayesian methods. And it is why the deep methods, sorry, why the deep ensembles work so well, because they end up in different minima. And that is, it's really interesting proposition. And what I find really interesting as well are the experiments that they do to show this. So they have a lot of these experiments right here. First of all, to the setup, they use C410, C4100, and so on. And on C410, you can see right here, they use a small CNN, medium CNN, and a ResNet. Now the small CNN and a ResNet. Now the small and medium CNNs, their accuracy is really, really subpar. So, take the results here with some grain of salt, because there are effects in these neural network that are really qualitatively different if you are seriously underperforming, like this one, like if you have a seriously too small network rather than a large network. Now they do verify all of their things also with this large network and 90% accuracy is acceptable for C410. I don't think there's the big qualitative difference between 90 and 95 and so on. But the 64, if it were only this, I would be rather critical of this work. But it's fine to, if you see the effect at 64, and then some of the effects you check to carry over to the 90% one, I'm going to generally believe you. Okay, so first of all, what they do here is they look at a training trajectory of just a single run. So this paper is half about ensembles, but also half generally about what does training of neural networks do? And they reach some very, very cool conclusions that even are independent of deep ensembles. So here, the first thing we do is we have some initial random initialization in weight space of your weight, and then you do gradient descent and you run and you run, right, and you get to some minima right here, some minimum right here. And then you do a second one. So you initialize somewhere else. And because you initialize somewhere else, you run, you run, you run, you end up at a different minimum. Okay, this is a property. So these are not convex functions, right? We know about neural networks, you'll end up a different minima, but the minima, they will, they will perform about equally well. So the question is, do those different minima that perform equally well, describe the same function? Or are they fundamentally different functions that just happen to reach the same accuracy? And the question is very interesting. And this paper attempts to answer that. So here you can see in the description, on the left, cosine similarity between checkpoints to measure weight space alignment along optimization trajectory. So we only consider one of these runs, only consider the left one, for example, and you plot it here, and here, this later one comes later, sorry. So you plot the left only a single run, and you ask yourself, the checkpoint that I have after epoch 20, how similar is it to the checkpoint that I have after epoch five? That would be right here. Now, we have to read up how they compare the checkpoints. And this is weight space alignment. Okay, so weight space alignment, it basically means how much do the weights align in the cosine fashion, as you can see right here, this is simply the cosine between the weights, this is one way of comparing two functions. If two functions align in weight space, there's a decent chance that they describe the same thing. So as you can see here, we go as we go down the optimization trajectory, of course, each one is similar to themselves. But you can see that there is kind of a shift right here. So at the beginning, the zero of checkpoint is very dissimilar to the checkpoint at the end. But after very short while, you kind of cross over, and then all these checkpoints right here are sort of similar. So the if you just look at two rows, you look at the bottom row, and you look at the top row, the bottom row tells you how similar are the checkpoints during training to the initial checkpoint. And you can see pretty quickly, they are very dissimilar. So at this point right here, there is kind of a dissimilarity happening where the checkpoint goes away from its initialization to something else. And the top row tells you how similar are they to where the network ends up. And you can see that there appears to be a period in, let's say here, where this shift away starts up until here, where it's kind of not similar to anything. But then after that, after here, everything is similar to the final checkpoint. Okay, so this is sort of tells us a hypothesis is that you initialize randomly somewhere you have this lost landscape, right? You initialize randomly somewhere here. And then you go go go and at some point you fall into one of one of those valleys, and then you simply go to that to that valley. If you initialize somewhere differently, you can see that at the beginning, you might be here somewhere, and then you fall into that valley over here. And after that, you're pretty much set. So this is going to be our hypothesis from now on that in these neural networks, you the initialization is basically you you're somewhere and you kind of meander around a bit until you happen to go into one of these directions, which happens pretty quickly. And then you fall into a hole basically. And that's that's rather a convex setting in that thing. Okay, a really interesting thing that they do is a really interesting thing is that they check the disagreement of predictions. So you might think that if a neural network achieves 65 or 90, let's call it 90% accuracy on C410, right, that there are just you know, there are this data set, that's 100%. And there are just these 10% over here, that are just the hardest, right. And the more you train, the more are you you're able to push this boundary to the right. So if you train more, if you have a better network, you're just able to explain more and more of the samples. However, this this experiment here is going to show that this is not the case. What they measure is the disagreement in predictions, which basically means that if I there is this data set, the validation data set, and if I have one random initialization and I train it to 90% accuracy, it will have it will say these, it will not be able to classify these here. But if I have the same network, but a different initialization, it might not be able to classify these over here, but will be perfectly able to classify these over here. Right. This is a very, also very interesting property. And you can see right here, the disagreement of predictions as you go through the training. So again, we're going to look at the bottom and the top row. So the bottom row, and the top row, red is very disagreeing, blue is very agreeing. You can see again, that that I introduced, again, I introduced the different runs, I'm already taking this away from later, we are just looking at one single run for now. This this is a result that's going to come up later, when we look at two different runs of the same neural network. And that's the astounding part. Okay, here, we're just going to look at one run again during training. So we can see right here at the beginning, of course, every checkpoint agrees with itself on the predictions. However, you can see that pretty quickly, the checkpoints start disagreeing very quickly, everything is red right here. However, on the top, you can see how much how much do these checkpoints agree with the end with the 30th epoch checkpoint, and see that there is a period that is red, right from here to let's say here. And then after that, they all start agreeing. So from here on out, it's all pretty blue, which basically means that that they agree with the last checkpoint. So with the that all of these agree with the end of the training. Again, this is our hypothesis here that once you're in this valley, that the function kind of stays the same, and you only sort of micro optimize the function. However, at the beginning, you decide into which of those valleys you want to go. And the different initializations will lead you to different valleys. And that's what they show right here. So they do a t-sne plot of predictions t-sne is a method to project to down project high dimensional vectors. And this is the weight space projected to two dimensions. So t-sne x is one, and two, these are rather arbitrary. It's just the if you think of a PCA, it's the directions of maximum variance. And you can see the three different runs, they immediately at the beginning right here, they immediately go, you can see they have they do large distances at the beginning, between the steps of optimization. And they do in very different directions, just by means of being initialized at different points and having maybe a bit of noise in the training process. But once they are at the particular location, they sort of just kind of bounce around right here and try to find the best minima in that region. So this is our first indication that the if we train the same network multiple times with random initializations, it's going to end up at multi at different places. And what we're wondering is we already know that a single network is very different at the end than at the beginning of training. What we want to know is our two networks also very different, even though they're trained on the same objective, just because they are at different places in the weight space doesn't mean they are functionally that different, there are symmetries. And it's going to turn out yes, they actually are very, very different. So this is right here, here you can see two different things. And we're going to read the plot along with it. Just so I remember what I'm seeing here. So using two different architectures, okay, for each of these architectures, the left subplot shows the cosine similarity between the different solution weight space, and the right subplot shows the fraction of labels on which the predictions from different solutions disagree. Okay, so it's the same as before, the left is the alignment. And now it's not during training. Now we restart independently, we train the same network 10 different times. And after that, we're going to compare the 10 different solutions. Remember, these all achieve roughly the same accuracy on the data sets. And this is the same whether you go to a big architecture like this ResNet 20, or to a small architecture like this small CNN right here. You can see that every single solution, of course, agrees a lot with itself. That's the diagonal right here. But it's completely, it's not a line, it's completely orthogonal to all the other solutions. So all the solutions in weight space are orthogonal. Now there's still the chance that there's, you know, some symmetry in weight space because, you know, if I have a neural network, I can just exchange the connections. And if I also exchange the neurons, then it will be the same function. However, you can see right here that they completely disagree. So this small CNN, remember, it had like a 65% accuracy, the solutions, the red here, they disagree on 25% of the labels. So that this is exactly this effect we saw before, we train one solution, and it will not be able to classify these parts of the validation data set. And we train the same network with the same data set with the same loss with everything the same, again, just from a random initialization that's different, it will end up equally performing equally well, but it will make the mistakes and an entirely different set of the validation data points. Like this is rather astounding, I feel, because I think most people are of the of the idea that all the kind of data points have an intrinsic hardness. And if if we get to 70% accuracy, it will always be the same 70% of data points that we miss classify or sorry, that we correctly classify. This is not the case. And this is one thing I think this paper and this line of research does pretty cool is to look at these networks in terms of their prediction agreement. So they go further and they compare this to four different methods. So they say, okay, ensembles, ensembles are one method of kind of doing these getting different solutions, which means we start from random initializations, but there are other ones. So for example, there is just place this correctly here, random subspace sampling. So what does it mean? They say we start at an optimized solution. So you train a network one single network, and then we choose a random direction at V in weight space, we step in that direction by choosing different values of t looking at the predictions at configurations, theta zero plus TV, we repeat this from many different V, but always the same theta zero. So in our original kind of drawing of this thing, we optimize one single network, let's say that's here. And then we sort of wiggle around in here, into different random directions. Now, of course, there's only one random direction right here. If maybe we can look at this at, at the so if here, we have the loss landscape, and maybe over here, there is a bit of a of a thing. And over here, there is a bit of a thing you thought I was going to draw. Okay, so we start here, and maybe that converges to somewhere here. So what we're going to do is we're going to select random directions in that space. And we're just going to go a few steps into this direction and compare the weights. Now here, you can already see by the way I'm drawing it that this will probably make you stay in the same region. And our hope with ensembles is of course, is that they are able to capture all of the three different modes right here. But it is a way to obtain different solutions that all also perform quite well, if you only perturb your solution by a little bit, it also works quite well. And you can build an ensemble out of these methods right here, you can build an ensemble out of these. In fact, these Bayesian methods, if you do these approximations with Gaussians, that's pretty much what they will end up doing is they will end up characterizing the local, the local landscape around one of these minimum. But here, we simply do it by randomly stepping into a direction. That's the first method that we're going to investigate to obtain an ensemble of different solutions. So deep ensembles means we initially random, we randomly initialize many times and then train from scratch each member. This method here means we start from an or from a solution and we simply perturb it into random directions. The next thing we can do is we can do dropout subspace dropout. We again start at an optimized solution, apply dropout with randomly chosen probability. Again, our hypothesis is going to be that this is going to keep the network rather in the sort of same kind of functional mode and not switch over diagonal Gaussian subspace. Again, we start from an optimized solution, you can see the pattern. And here we actually do some sort of a Gaussian approximation to the functional space, we calculate a mean and a standard deviation. And we draw samples of the parameters from that distribution. And then the same in a low rank regime. And here you see what happens. So here is these things, for example, the random subspaces. Here is this overlapped with the plot we saw before. So here we have three different trajectories of runs. And then at the end of each trajectory, we take the best solution, and we do this random exploration around it. And this here is the t-sne, the t-sne projection. Now this isn't, I have to say this isn't the projection of the weights itself. Sorry, I did not say that before. This is a projection of the predictions, I believe of a subset of data points. So this is the prediction projection of that. And you can see that if we perturb the solutions like this, all of these solutions, all of these ensembles, they rather they stay in their basin of attraction, as you can see right here. So with a deep ensemble, we would build an ensemble that, sorry, sorry, sorry. We would build an ensemble that combines this point, and this point, and this point. Whereas here, we will simply either build an ensemble that combines points in here, or we'll build an ensemble that combines points in here, and so on. And you'll see this for all the different methods that we consider here, especially the Gaussian methods. And that's a hint to why, even though Bayesian networks explicitly try to capture the entire distribution right here, what they'll end up doing is they'll simply end up capturing a single mode. And that's important because the single mode is always functionally sort of equal. We saw that this is a training trajectory, and at the end of training, after like this step right here, all the functions are pretty much the same, right? They pretty much agree with the end optimum. Whereas between the runs, these functions completely disagree with each other. So it is important if we want to build an ensemble to capture as many of these modes as possible, and only the deep ensembles can do that so far. So this is another experiment where they show this lost landscape. And I really like these kind of plots. So what you see here is a plane, it's a 2D plane. And the 2D plane is described by three points. So one point is the origin, you see right here the origin, that's the origin of that's the zero in weight space. Okay, then what you have are the two optima. So you run an optimization, and then you run an optimization two different times. Once it's initialized here, and it runs to here. And once it's initialized here, and it runs to here. Okay, so that defines the plane that we're going to look at. Now they for each single pixel in this plane, or actually for each single pixel in this half circle right here, they evaluated the networks. So what you'll do is simply do linear combination of these weight of the weight vector here at this optimum, the weight vector here at this optimum. And you can for each point here defines a neural network with those weights. And you can evaluate it. And that's what you get. This is the accuracy of the neural network at that point. So here you can see very, very clearly that there are these two different modes right here. So each even though they're initialized super close to each other, right, you can see this right here, they're initialized super close to each other, because they are this is the flat area right here that we saw before, because they are in the flat area. They're even though they're initialized pretty close, the red one is a little bit more to this basin of attraction, the blue one is a little bit more to this basin of attraction. So they move over and as soon as they're in, it's like boom, they go to the minimum of that basin. And this area is rather convex. And this area is rather convex. And in the middle, you can see is a less is more loss. So no solution will go there. That's how you get these different minima. That's how you get these different modes. And you can see the accuracy or from the color is going to be the same in each of the in each of the valleys, consistent with our what we know so far. Now here, the pink stripe is a Gaussian exploration. So if you now do a Gaussian perturbation Gaussian exploration around this minimum, you basically you can see again, you don't get out of this valley, you don't you're not going to go to different modes, the weight space is just too large, and you're going to simply be stuck in there. So the only chance almost you have is to initialize again, and hope that you end up in a different place. And I guess my hypothesis is that there are many, many more of these valleys of these basins than that you can you could ever capture. So basically, every single initialization that is different will lead you to a different one of these basins. I guess it's only a matter of this size. So here again, they do a function similarity. So in this case, it's the function similarity to optimum one. And this is again, how many of the labels agree with the optimum right here. And you can see that within this basin of attraction, you have fairly high overlap of the functional similarity. But here, none, right? So 15% or so, it's not going to be zero, because they're going to agree on like some of the examples, I guess there's still something like intrinsic hardness, but they agree on almost none of the labels, at least I guess, if you normalize by their base accuracy. So even though optimum two is performing as well, it is functionally extremely dissimilar to optimum one. So these describe really different functions. And I really don't know what to make of this other than, you know, each one of these is maybe sort of deciding to look at different features in the in the data set, right? To or to maybe build different high level features from the same low level features. And maybe we're still under parameterizing these models, because not a single model can sort of look at both features at the same time, as evidenced by the fact that each of these is always going to one of these things. Or it could be that in fact, the task is way too simple. And it's it can be solved in like 500 different ways. And each of these Optima is simply one way of solving the task one way of combining feature. And it's actually completely an over specified problem. That's another hypothesis, it would be, I guess, interesting to look at these things. And I'm sure there's work on this. So you can see the same thing for optimum two right here, where, okay, go away, where you can see that optimum one, it agrees almost nothing with optimum two, right? It doesn't it doesn't agree. There's not even a hint of a valley right here, in the terms of functional similarity. That is very, very interesting. So it really means that these two things describe two different functions. They do these other plots right here, that they call diversity versus accuracy plots. So what they'll do is they are going to have different models, and they're going to look at them in terms of their diversity and their accuracy. So here, the y axis is going to be how different are these functions, and that's going to be again in fraction of labels changed normalized by the base accuracy. So here you can see, we're always start from this baseline optimum, this baseline optimum has zero diversity zero, because it agrees with itself on all the on all the different labels, of course. And then we're going to disturb that using our four methods that we defined before. So we're going to randomly subspace, we're going to drop out, we're going to Gaussian perturb it, and so on. And the more we perturb it, the more diverse our function is going to be naturally, right? Because we perturb the function, it starts disagreeing more and more and more with our original optimum. However, what we also expect is, you know, if we are in the local optimum, and maybe here, and you know, maybe the validation accuracy is sort of beside it, or a little bit larger, and so on. So if we perturb it a little bit, you know, that might not make too much to our accuracy. But if we perturb it a lot, you know, we go actually up the loss landscape, and then we get less accuracy also on the validation set. So that's what you see right here in these in these this curve right here, as you make the function more diverse, so you perturb it a little bit, you see that your accuracy doesn't suffer too much, you kind of stay at the same accuracy. But as if you make it more and more and more diverse, you can see that the accuracy suffers until the diversity of one basically means that you disagree on the maximum amount of labels that you can. And so you're sort of sort of out of this valley right here. And also, you can see that your accuracy goes to zero. So the more these functions disagree, the less their accuracy is, that seems natural. However, you can see that these red stars right here, they seem to be also very different, they seem to not agree with the original baseline optimum, but they seem to be doing perfectly fine in terms of accuracy, be at the same accuracy. And those are the independent optima, those are the optima from runs where we initialized at a different point and then also trained. And that, again, is evidence for the fact that there are probably other optima far away, where these different initializations find this here. So they are very different in terms of functional space, they're quite far apart, they predict different things. However, in terms of loss, they're almost the same or actually the same. So this is very, very cool experiments right here. And they do this for the different for different architectures. And you can see that, especially the larger architectures, this actually happens more pronounced. And they also make the point of saying, if you go to harder problems like a CIFAR 100 or an image net, this this effect is more pronounced that you can see, these here are closer together as a curve. And these these are these these are the the independent optima. So I hope you're all you're already on board and still know why we're doing these things. We're doing these things because we want to build some sort of ensemble that captures the distribution of solutions in order to generalize better. Now we have two options, either we start kind of from a an optimum and characterize the space around that optimum, which is what these methods do right here. And what also the Bayesian methods do this, even though they don't want to, because they do these approximations, because they're intractable, they're going to end up doing this. Or our other our other option is to restart training a bunch of times. And then we end up at different optima. And the point of the paper is it's better to do that than to build the ensemble out of the of these Gaussian methods or of these perturbation methods. And the paper, I guess the main claim of the paper is why that happens. And it happens because the ensemble members obtain different minima that are functionally different. Okay, so exactly, that's what they do here. So they now build ensembles out of these different things. And you can see that here on the x axis, you have the ensemble size. So how many ensemble members do you have? And the dashed lines here are the baseline accuracies if you just have a single model. And the test accuracy is plotted on the y axis. Now I actually was, I was not, that's not correct. You always build the ensemble out of random initializations. But on top of that, you do these things. So what you can see right here is, if I have this classifier, which is my original classifier, and I add on top of that, this PCA Gaussian, you know, perturbation stuff, I increase in accuracy. However, if I build an ensemble, I increase in accuracy, if I build an ensemble out of 10 members, I increase in accuracy this much. And then if, because I can do both things. So if I increase if I do an ensemble, and then on top of that to the PCA Gaussian, I gain another this much right here. So that's sort of evidence for the fact that you'd rather build an ensemble than do this, these other methods of, of approximating the Bayesian posterior of weights. So yes, I'm, I'm sort of convinced. I hope you are too. And they do a lot of they do some more experiments right here where you can see that the difference between so this is single model, sorry, this is, I guess, here, accuracy, oh, yeah, if you this is the out of distribution test, so you can take a data set, and you can corrupt it by corruption. So there are predefined data sets, but you can also do it yourself, you crop it, you can do luminosity, whatever, you can destroy parts of the image, you can see that having more ensemble members, so this is your original models, here is how they sync with increasing corruption. It almost doesn't matter which ones of these methods you do, you see the bottom one is the original model, and you gain a little bit by doing these things, but not nearly as much by building an ensemble and going here, or actually an ensemble of two members or five members, in which case you jump this much in accuracy. So these ensembles from different initializations are also very, very, are also very good at countering corruption, which you see also here. Yeah, so this is the JS divergence, okay, I've read that, but let's not go here, videos already too long. And this is the last thing is on ImageNet test set and the ImageNet corrupted set, where they pretty much show the same thing. It's not as pronounced here, but you can see pretty much how the different, if you go from single model to ensemble with two members to ensemble with four members, there is a general upwards trend, and the general upwards trend is much less pronounced within each ensemble, so if you go just go from method to method, then it is between the different groups of ensembles, meaning that the ensemble is a much more pronounced effect that these other effects. So I hope I have convinced you a little bit of how these subspaces look like, how the loss landscape of neural networks look like, especially the fact that there are these different minima, and the random initializations of these different groups of models, and the random initializations will almost always hit these different minima. And the interesting part is that even though these different minima perform equally well, they are functionally very different. And an ensemble of differently initialized and independently optimized models can actually capture these different modes of the functional space. And therefore, if you build an ensemble out of that, it will generalize better, because it kind of can draw information from all of those different modes, rather than if you do some sort of Bayesian network, which will, because you have to approximate usually with Gaussians, will end up only covering one of these modes. That is sort of a good summary of what this paper says. Again, I enjoy research like this, because it's easy and it gives, it kind of makes you think, right? So I'll be thinking about these things for a while now and thinking of new kind of experiments that one could do. And yeah, as I said, this research is still wide open. We don't know so many things about neural network. And you know, tell me, tell me what you think is going on, actually, that that would be very interesting. And yeah, I'll see you next time. Bye bye.
 Hi there! Today we'll look at Deep Ensembles, a lost landscape perspective by Stanislav Fort,
 Hui Yi Hu and Balaji Lakshminarayanan. This paper on a high level explains the lost landscape
 of deep ensemble models, so ensembles of deep neural network. And it hypothesizes, and it
 shows through experiments, that each member of the ensemble, by means of being initialized
 at a random point, will go and, through optimization, go and end up at a different place in weight
 space. And therefore the deep ensemble is able to capture different modes of the functional space,
 of the space of solutions. They compare this to Bayesian networks, which are sort of promised to
 do the same thing, but they often only characterize a single mode, and therefore they don't generalize
 as well. So join me exploring this paper, I think it's a pretty cool paper. The experiments are
 cleverly designed to show what they're supposed to show, and I generally enjoy this type of research
 because it's kind of an explanatory research that shows you what's going on inside of these networks,
 rather than, you know, chasing the next state-of-the-art number. It's also an example of research that you
 can still do while you don't have, you know, giant resources of compute, even though this is by
 DeepMind. But I do believe that this kind of research is still, you know, wide open and
 available to academia, and whereas the other kind, the state-of-the-art kind, slowly goes into more
 and more of the money game. All right, in any case, join me in reading this paper. If you like it,
 share it out, leave a comment to tell me what you think, and leave a like if you enjoyed it.
 All right, so we'll start off. The abstract says, deep ensembles have been empirically shown to be
 a promising approach for improving accuracy, uncertainty, and out-of-distribution robustness
 of deep learning models. So what are deep ensembles? Really quick, an ensemble model, and we're in the
 classification setting. So in the classification setting, we have data points, and each data point
 has features, so which are the x, x is some kind of d-dimensional feature, and then you have y,
 which is the label. So that's in some, let's say that's some natural number or something like this,
 or is element of a class set. Now that's the complex numbers. It's element of some bounded
 set of class labels, so it's either a cat or a dog or you know, whatever you want. So you have a
 data set of these things, and your plan is to use x to predict y. If you build a model, a deep neural
 network, for example, for this task, you would simply characterize this function here, you would
 parameterize it as a deep neural network of many, many layers. If you build an ensemble now, what you
 would do is you would take the data set and simply train multiple different ones of these deep neural
 networks. So you'll train multiple different ones. And if you now want to classify data point, you'll
 input that data point into all of these three. And at the end, you would somehow aggregate, and there
 are different methods of doing this, but the most obvious one is simply either to aggregate by the
 mean or the mode, median, whatever you want, you could also kind of also learn something here. But
 you can just average the predictions. And that will usually give you a better prediction than if
 you only have one model. So this is called an ensemble model. And if the ensemble members,
 these things here are neural networks or deep networks, this is called a deep ensemble. So why
 do we hope to become better? That's the point of this paper is to show what happens in the lost
 landscape of these deep neural networks. And why do they perform better than other methods that are
 supposed to achieve the same thing. So usually, when you build an ensemble model, what are you
 hoping for? You're hoping to sort of learn a generalizable function. And they have this drawing
 right here, where it's a bit of a you have to sort of think differently than you usually do. So on
 the x axis, you have the space of solutions. So imagine that your, your neural network only has a
 single weight. So this axis here is that single weight, or you can project or or whatnot, this is
 the space of different solutions. So after you optimize, you land somewhere on this axis. And you
 can see that there is a solid line which represents the accuracy on the training set. And then there
 is a dashed line which represents the accuracy of the validation set for a given parameter. So what
 you usually do is you optimize one neural network to its very best training accuracy. So let's say
 you start off here, what you would do is you would see my training accuracy is this high, I need a
 different color right here is this high. And you calculate the gradient, and you could do gradient
 descent. And that means you go down the loss up the accuracy. So you go over and over and over
 until you reach this point right here, where you have maximum training accuracy, and then you'll
 suffer some generalization loss like you're gonna see right here, it's all for some generalization
 loss, because the validation accuracy at that point isn't as high. But generally, it's correlated,
 as you can see, by the general overlap of these two lines of these two shapes right here. Okay,
 so this is called a maximum a posteriori estimate, you simply optimize one neural network until the
 best training error. There are different approaches right here, there are approaches that say, okay,
 we can do we could do better. So first of all, what you see right here is rather peculiar. And
 you might not be used to this, that there are different peaks right here, there are different
 peaks, as you can see in the training and the validation error. So they're correlated. And the
 idea is that neural networks are very nonlinear. And we've known from other papers that they have
 many, many local minima. And in fact, so this is one of the astounding things about neural network,
 most of these minima are performing equally well. So even though the neural network has different
 local minima, they all perform about equally well. And other papers even say they're all sort of
 connected on a low loss landscape. So there are many, many things that are still mysterious about
 neural network. But we know that there are multiple minima. And we know that we basically need to find
 one of them. And it doesn't really matter which one they all perform sort of equally well. Now,
 as you can, as you might imagine, there are people who aren't really satisfied with this. And there
 are approaches to say, why don't we just capture this entire curve right here. So if we could build
 a model that could not only tell us at this point right here, you're this good, but could tell us
 that at any point, how good we are captured the entire distribution of solutions. And these are
 usually in the category of the Bayesian neural networks, they try to capture the entire distribution.
 Of course, that's not really feasible, because you always have to calculate that posterior.
 So what they end up doing is they do some approximation. And usually they do some sort
 of a multivariate Gaussian approximation, because you can calculate posteriors in closed form and so
 on. And this paper, this paper's hypothesis is that these can only usually capture one of these
 peaks. So they are very able to capture the surrounding right here, they're, they can capture
 very accurately what happens around this particular peak. They are very aware of the shape of the
 curvature here, and can tell you a lot of things about it. So they can tell you, for example, that
 the validation so that you might want to be a bit over here, rather than over here. But they cannot
 they don't generally know about these other modes, because they are only approximations.
 They generally don't produce multimodal solutions. Another approach is a deep ensemble.
 Now, this paper shows that in general, if you train a deep ensemble, what will happen is because
 you randomly initialize the deep ensemble, at some points, it will happen that if you do gradient
 descent on all of them, they will end up sort of covering all these different modes, they still
 they don't have an idea of you know, the curvature, sorry, this one shouldn't go here,
 this one should go here, the curve, they don't really know about the curvature, but they will
 give you these different minima right here. And therefore, they can capture the landscape much,
 much more easily. If you know that these three are minima, you sort of, it might look something like
 this. And that's a hell of a lot better than simply the Bayesian approximation that you have
 to capture one of the peaks, but really accurately. So, their hypothesis here is that deep ensembles
 do this job of capturing the different modes of the functional space much better than the Bayesian
 methods. And it is why the deep methods, sorry, why the deep ensembles work so well, because they
 end up in different minima. And that is, it's really interesting proposition. And what I find
 really interesting as well are the experiments that they do to show this. So they have a lot of these
 experiments right here. First of all, to the setup, they use C410, C4100, and so on. And on C410,
 you can see right here, they use a small CNN, medium CNN, and a ResNet. Now the small CNN
 and a ResNet. Now the small and medium CNNs, their accuracy is really, really subpar. So,
 take the results here with some grain of salt, because there are effects in these neural network
 that are really qualitatively different if you are seriously underperforming, like this one,
 like if you have a seriously too small network rather than a large network. Now they do verify
 all of their things also with this large network and 90% accuracy is acceptable for C410. I don't
 think there's the big qualitative difference between 90 and 95 and so on. But the 64,
 if it were only this, I would be rather critical of this work. But it's fine to, if you see the
 effect at 64, and then some of the effects you check to carry over to the 90% one, I'm going to
 generally believe you. Okay, so first of all, what they do here is they look at a training trajectory
 of just a single run. So this paper is half about ensembles, but also half generally about
 what does training of neural networks do? And they reach some very, very cool conclusions that even
 are independent of deep ensembles. So here, the first thing we do is we have some initial random
 initialization in weight space of your weight, and then you do gradient descent and you run and you
 run, right, and you get to some minima right here, some minimum right here. And then you do a second
 one. So you initialize somewhere else. And because you initialize somewhere else, you run, you run,
 you run, you end up at a different minimum. Okay, this is a property. So these are not convex
 functions, right? We know about neural networks, you'll end up a different minima, but the minima,
 they will, they will perform about equally well. So the question is, do those different minima that
 perform equally well, describe the same function? Or are they fundamentally different functions
 that just happen to reach the same accuracy? And the question is very interesting. And this paper
 attempts to answer that. So here you can see in the description, on the left, cosine similarity
 between checkpoints to measure weight space alignment along optimization trajectory. So we
 only consider one of these runs, only consider the left one, for example, and you plot it here,
 and here, this later one comes later, sorry. So you plot the left only a single run, and you ask
 yourself, the checkpoint that I have after epoch 20, how similar is it to the checkpoint that I have
 after epoch five? That would be right here. Now, we have to read up how they compare the checkpoints.
 And this is weight space alignment. Okay, so weight space alignment, it basically means how much do
 the weights align in the cosine fashion, as you can see right here, this is simply the cosine between
 the weights, this is one way of comparing two functions. If two functions align in weight space,
 there's a decent chance that they describe the same thing. So as you can see here,
 we go as we go down the optimization trajectory, of course, each one is similar to themselves. But
 you can see that there is kind of a shift right here. So at the beginning, the zero of checkpoint
 is very dissimilar to the checkpoint at the end. But after very short while, you kind of cross over,
 and then all these checkpoints right here are sort of similar. So the
 if you just look at two rows, you look at the bottom row, and you look at the top row,
 the bottom row tells you how similar are the checkpoints during training to the initial
 checkpoint. And you can see pretty quickly, they are very dissimilar. So at this point right here,
 there is kind of a dissimilarity happening where the checkpoint goes away from its initialization
 to something else. And the top row tells you how similar are they to where the network ends up.
 And you can see that there appears to be a period in, let's say here, where this shift away starts
 up until here, where it's kind of not similar to anything. But then after that, after here,
 everything is similar to the final checkpoint. Okay, so this is sort of tells us a hypothesis is
 that you initialize randomly somewhere you have this lost landscape, right? You initialize randomly
 somewhere here. And then you go go go and at some point you fall into one of one of those valleys,
 and then you simply go to that to that valley. If you initialize somewhere differently, you can see
 that at the beginning, you might be here somewhere, and then you fall into that valley over here.
 And after that, you're pretty much set. So this is going to be our hypothesis from now on that
 in these neural networks, you the initialization is basically you you're somewhere and you kind of
 meander around a bit until you happen to go into one of these directions, which happens pretty
 quickly. And then you fall into a hole basically. And that's that's rather a convex setting in that
 thing. Okay, a really interesting thing that they do is a really interesting thing is that they check
 the disagreement of predictions. So you might think that if a neural network achieves 65 or 90,
 let's call it 90% accuracy on C410, right, that there are just you know, there are this data set,
 that's 100%. And there are just these 10% over here, that are just the hardest, right. And the
 more you train, the more are you you're able to push this boundary to the right. So if you train
 more, if you have a better network, you're just able to explain more and more of the samples.
 However, this this experiment here is going to show that this is not the case. What they measure
 is the disagreement in predictions, which basically means that if I there is this data set,
 the validation data set, and if I have one random initialization and I train it to 90% accuracy,
 it will have it will say these, it will not be able to classify these here. But if I have the
 same network, but a different initialization, it might not be able to classify these over here,
 but will be perfectly able to classify these over here. Right. This is a very, also very interesting
 property. And you can see right here, the disagreement of predictions as you go through
 the training. So again, we're going to look at the bottom and the top row. So the bottom row,
 and the top row, red is very disagreeing, blue is very agreeing. You can see again, that
 that I introduced, again, I introduced the different runs, I'm already taking this away from later,
 we are just looking at one single run for now. This this is a result that's going to come up
 later, when we look at two different runs of the same neural network. And that's the astounding
 part. Okay, here, we're just going to look at one run again during training. So we can see right
 here at the beginning, of course, every checkpoint agrees with itself on the predictions. However,
 you can see that pretty quickly, the checkpoints start disagreeing very quickly, everything is red
 right here. However, on the top, you can see how much how much do these checkpoints agree
 with the end with the 30th epoch checkpoint, and see that there is a period that is red,
 right from here to let's say here. And then after that, they all start agreeing. So from here on out,
 it's all pretty blue, which basically means that that they agree with the last checkpoint. So with
 the that all of these agree with the end of the training. Again, this is our hypothesis here that
 once you're in this valley, that the function kind of stays the same, and you only sort of
 micro optimize the function. However, at the beginning, you decide into which of those
 valleys you want to go. And the different initializations will lead you to different
 valleys. And that's what they show right here. So they do a t-sne plot of predictions t-sne is
 a method to project to down project high dimensional vectors. And this is the weight space projected to
 two dimensions. So t-sne x is one, and two, these are rather arbitrary. It's just the if you think
 of a PCA, it's the directions of maximum variance. And you can see the three different runs, they
 immediately at the beginning right here, they immediately go, you can see they have they do
 large distances at the beginning, between the steps of optimization. And they do in very
 different directions, just by means of being initialized at different points and having maybe
 a bit of noise in the training process. But once they are at the particular location, they sort of
 just kind of bounce around right here and try to find the best minima in that region. So
 this is our first indication that the if we train the same network multiple times with random
 initializations, it's going to end up at multi at different places. And what we're wondering is we
 already know that a single network is very different at the end than at the beginning of training.
 What we want to know is our two networks also very different, even though they're trained on the same
 objective, just because they are at different places in the weight space doesn't mean they are
 functionally that different, there are symmetries. And it's going to turn out yes, they actually are
 very, very different. So this is right here, here you can see two different things. And we're going
 to read the plot along with it. Just so I remember what I'm seeing here. So using two different
 architectures, okay, for each of these architectures, the left subplot shows the cosine similarity
 between the different solution weight space, and the right subplot shows the fraction of labels on
 which the predictions from different solutions disagree. Okay, so it's the same as before,
 the left is the alignment. And now it's not during training. Now we restart independently,
 we train the same network 10 different times. And after that, we're going to compare the 10
 different solutions. Remember, these all achieve roughly the same accuracy on the data sets. And
 this is the same whether you go to a big architecture like this ResNet 20, or to a small
 architecture like this small CNN right here. You can see that every single solution, of course,
 agrees a lot with itself. That's the diagonal right here. But it's completely, it's not a line,
 it's completely orthogonal to all the other solutions. So all the solutions in weight space
 are orthogonal. Now there's still the chance that there's, you know, some symmetry in weight space
 because, you know, if I have a neural network, I can just exchange the connections. And if I also
 exchange the neurons, then it will be the same function. However, you can see right here that
 they completely disagree. So this small CNN, remember, it had like a 65% accuracy, the solutions,
 the red here, they disagree on 25% of the labels. So that this is exactly this effect we saw before,
 we train one solution, and it will not be able to classify these parts of the validation data set.
 And we train the same network with the same data set with the same loss with everything the same,
 again, just from a random initialization that's different, it will end up equally performing
 equally well, but it will make the mistakes and an entirely different set of the validation data
 points. Like this is rather astounding, I feel, because I think most people are of the of the idea
 that all the kind of data points have an intrinsic hardness. And if if we get to 70% accuracy,
 it will always be the same 70% of data points that we miss classify or sorry, that we correctly
 classify. This is not the case. And this is one thing I think this paper and this line of research
 does pretty cool is to look at these networks in terms of their prediction agreement. So they go
 further and they compare this to four different methods. So they say, okay, ensembles, ensembles
 are one method of kind of doing these getting different solutions, which means we start from
 random initializations, but there are other ones. So for example, there is just place this correctly
 here, random subspace sampling. So what does it mean? They say we start at an optimized solution.
 So you train a network one single network, and then we choose a random direction at V in weight
 space, we step in that direction by choosing different values of t looking at the predictions
 at configurations, theta zero plus TV, we repeat this from many different V, but always the same
 theta zero. So in our original kind of drawing of this thing, we optimize one single network,
 let's say that's here. And then we sort of wiggle around in here, into different random
 directions. Now, of course, there's only one random direction right here. If maybe we can look at this
 at, at the so if here, we have the loss landscape, and maybe over here, there is a bit of a
 of a thing. And over here, there is a bit of a thing you thought I was going to draw.
 Okay, so we start here, and maybe that converges to somewhere here. So what we're going to do is
 we're going to select random directions in that space. And we're just going to go a few steps into
 this direction and compare the weights. Now here, you can already see by the way I'm drawing it that
 this will probably make you stay in the same region. And our hope with ensembles is of course,
 is that they are able to capture all of the three different modes right here. But it is a way to
 obtain different solutions that all also perform quite well, if you only perturb your solution by
 a little bit, it also works quite well. And you can build an ensemble out of these methods right
 here, you can build an ensemble out of these. In fact, these Bayesian methods, if you do these
 approximations with Gaussians, that's pretty much what they will end up doing is they will
 end up characterizing the local, the local landscape around one of these minimum. But here,
 we simply do it by randomly stepping into a direction. That's the first method that we're
 going to investigate to obtain an ensemble of different solutions. So deep ensembles means we
 initially random, we randomly initialize many times and then train from scratch each member.
 This method here means we start from an or from a solution and we simply perturb it into random
 directions. The next thing we can do is we can do dropout subspace dropout. We again start at an
 optimized solution, apply dropout with randomly chosen probability. Again, our hypothesis is going
 to be that this is going to keep the network rather in the sort of same kind of functional mode
 and not switch over diagonal Gaussian subspace. Again, we start from an optimized solution,
 you can see the pattern. And here we actually do some sort of a Gaussian approximation to the
 functional space, we calculate a mean and a standard deviation. And we draw samples of
 the parameters from that distribution. And then the same in a low rank regime. And here you see
 what happens. So here is these things, for example, the random subspaces.
 Here is this overlapped with the plot we saw before. So here we have three different trajectories
 of runs. And then at the end of each trajectory, we take the best solution, and we do this random
 exploration around it. And this here is the t-sne, the t-sne projection. Now this isn't, I have to
 say this isn't the projection of the weights itself. Sorry, I did not say that before. This is a
 projection of the predictions, I believe of a subset of data points. So this is the prediction
 projection of that. And you can see that if we perturb the solutions like this, all of these
 solutions, all of these ensembles, they rather they stay in their basin of attraction, as you can see
 right here. So with a deep ensemble, we would build an ensemble that, sorry, sorry, sorry.
 We would build an ensemble that combines this point, and this point, and this point. Whereas
 here, we will simply either build an ensemble that combines points in here, or we'll build an
 ensemble that combines points in here, and so on. And you'll see this for all the different methods
 that we consider here, especially the Gaussian methods. And that's a hint to why, even though
 Bayesian networks explicitly try to capture the entire distribution right here, what they'll end
 up doing is they'll simply end up capturing a single mode. And that's important because the
 single mode is always functionally sort of equal. We saw that this is a training trajectory,
 and at the end of training, after like this step right here, all the functions are pretty much the
 same, right? They pretty much agree with the end optimum. Whereas between the runs, these functions
 completely disagree with each other. So it is important if we want to build an ensemble to
 capture as many of these modes as possible, and only the deep ensembles can do that so far. So this
 is another experiment where they show this lost landscape. And I really like these kind of plots.
 So what you see here is a plane, it's a 2D plane. And the 2D plane is described by three points.
 So one point is the origin, you see right here the origin, that's the origin of that's the zero in
 weight space. Okay, then what you have are the two optima. So you run an optimization, and then you
 run an optimization two different times. Once it's initialized here, and it runs to here. And once
 it's initialized here, and it runs to here. Okay, so that defines the plane that we're going to look
 at. Now they for each single pixel in this plane, or actually for each single pixel in this half
 circle right here, they evaluated the networks. So what you'll do is simply do linear combination
 of these weight of the weight vector here at this optimum, the weight vector here at this optimum.
 And you can for each point here defines a neural network with those weights. And you can evaluate
 it. And that's what you get. This is the accuracy of the neural network at that point. So here you
 can see very, very clearly that there are these two different modes right here. So each even though
 they're initialized super close to each other, right, you can see this right here, they're
 initialized super close to each other, because they are this is the flat area right here that
 we saw before, because they are in the flat area. They're even though they're initialized pretty
 close, the red one is a little bit more to this basin of attraction, the blue one is a little bit
 more to this basin of attraction. So they move over and as soon as they're in, it's like boom,
 they go to the minimum of that basin. And this area is rather convex. And this area is rather
 convex. And in the middle, you can see is a less is more loss. So no solution will go there. That's
 how you get these different minima. That's how you get these different modes. And you can see the
 accuracy or from the color is going to be the same in each of the in each of the valleys,
 consistent with our what we know so far. Now here, the pink stripe is a Gaussian exploration.
 So if you now do a Gaussian perturbation Gaussian exploration around this minimum,
 you basically you can see again, you don't get out of this valley, you don't you're not going to go
 to different modes, the weight space is just too large, and you're going to simply be stuck in there.
 So the only chance almost you have is to initialize again, and hope that you end up in a different
 place. And I guess my hypothesis is that there are many, many more of these valleys of these basins
 than that you can you could ever capture. So basically, every single initialization that is
 different will lead you to a different one of these basins. I guess it's only a matter of this size.
 So here again, they do a function similarity. So in this case, it's the function similarity
 to optimum one. And this is again, how many of the labels agree with the optimum right here.
 And you can see that within this basin of attraction, you have fairly high overlap of the functional
 similarity. But here, none, right? So 15% or so, it's not going to be zero, because they're going
 to agree on like some of the examples, I guess there's still something like intrinsic hardness,
 but they agree on almost none of the labels, at least I guess, if you normalize by their base
 accuracy. So even though optimum two is performing as well, it is functionally extremely dissimilar
 to optimum one. So these describe really different functions. And I really don't know what to make of
 this other than, you know, each one of these is maybe sort of deciding to look at different
 features in the in the data set, right? To or to maybe build different high level features from
 the same low level features. And maybe we're still under parameterizing these models, because not a
 single model can sort of look at both features at the same time, as evidenced by the fact that
 each of these is always going to one of these things. Or it could be that in fact, the task
 is way too simple. And it's it can be solved in like 500 different ways. And each of these
 Optima is simply one way of solving the task one way of combining feature. And it's actually
 completely an over specified problem. That's another hypothesis, it would be, I guess,
 interesting to look at these things. And I'm sure there's work on this. So you can see the same thing
 for optimum two right here, where, okay, go away, where you can see that optimum one, it agrees
 almost nothing with optimum two, right? It doesn't it doesn't agree. There's not even a
 hint of a valley right here, in the terms of functional similarity. That is very, very
 interesting. So it really means that these two things describe two different functions.
 They do these other plots right here, that they call diversity versus accuracy plots. So
 what they'll do is they are going to have different models, and they're going to look at them
 in terms of their diversity and their accuracy. So here, the y axis is going to be how different
 are these functions, and that's going to be again in fraction of labels changed normalized by the
 base accuracy. So here you can see, we're always start from this baseline optimum, this baseline
 optimum has zero diversity zero, because it agrees with itself on all the on all the different labels,
 of course. And then we're going to disturb that using our four methods that we defined before.
 So we're going to randomly subspace, we're going to drop out, we're going to Gaussian perturb it,
 and so on. And the more we perturb it, the more diverse our function is going to be naturally,
 right? Because we perturb the function, it starts disagreeing more and more and more with our
 original optimum. However, what we also expect is, you know, if we are in the local optimum,
 and maybe here, and you know, maybe the validation accuracy is sort of beside it, or a little bit
 larger, and so on. So if we perturb it a little bit, you know, that might not make too much to our
 accuracy. But if we perturb it a lot, you know, we go actually up the loss landscape, and then we get
 less accuracy also on the validation set. So that's what you see right here in these in these this
 curve right here, as you make the function more diverse, so you perturb it a little bit, you see
 that your accuracy doesn't suffer too much, you kind of stay at the same accuracy. But as if you
 make it more and more and more diverse, you can see that the accuracy suffers until the diversity
 of one basically means that you disagree on the maximum amount of labels that you can. And so
 you're sort of sort of out of this valley right here. And also, you can see that your accuracy
 goes to zero. So the more these functions disagree, the less their accuracy is, that seems natural.
 However, you can see that these red stars right here, they seem to be also very different, they
 seem to not agree with the original baseline optimum, but they seem to be doing perfectly fine
 in terms of accuracy, be at the same accuracy. And those are the independent optima, those are
 the optima from runs where we initialized at a different point and then also trained.
 And that, again, is evidence for the fact that there are probably other optima far away,
 where these different initializations find this here. So they are very different in terms of
 functional space, they're quite far apart, they predict different things. However, in terms of
 loss, they're almost the same or actually the same. So this is very, very cool experiments
 right here. And they do this for the different for different architectures. And you can see that,
 especially the larger architectures, this actually happens more pronounced. And they also make the
 point of saying, if you go to harder problems like a CIFAR 100 or an image net, this this effect is
 more pronounced that you can see, these here are closer together as a curve. And these these are
 these these are the the independent optima. So I hope you're all you're already on board
 and still know why we're doing these things. We're doing these things because we want to build some
 sort of ensemble that captures the distribution of solutions in order to generalize better.
 Now we have two options, either we start kind of from a an optimum and characterize the space
 around that optimum, which is what these methods do right here. And what also the Bayesian methods
 do this, even though they don't want to, because they do these approximations, because they're
 intractable, they're going to end up doing this. Or our other our other option is to restart
 training a bunch of times. And then we end up at different optima. And the point of the paper is
 it's better to do that than to build the ensemble out of the of these Gaussian methods or of these
 perturbation methods. And the paper, I guess the main claim of the paper is why that happens. And
 it happens because the ensemble members obtain different minima that are functionally different.
 Okay, so exactly, that's what they do here. So they now build ensembles out of these different things.
 And you can see that here on the x axis, you have the ensemble size. So how many ensemble members
 do you have? And the dashed lines here are the baseline accuracies if you just have a single model.
 And the test accuracy is plotted on the y axis. Now I actually was, I was not, that's not correct.
 You always build the ensemble out of random initializations. But on top of that, you do these
 things. So what you can see right here is, if I have this classifier, which is my original classifier,
 and I add on top of that, this PCA Gaussian, you know, perturbation stuff, I increase in accuracy.
 However, if I build an ensemble, I increase in accuracy, if I build an ensemble out of 10 members,
 I increase in accuracy this much. And then if, because I can do both things. So if I increase
 if I do an ensemble, and then on top of that to the PCA Gaussian, I gain another this much right here.
 So that's sort of evidence for the fact that you'd rather build an ensemble than do this,
 these other methods of, of approximating the Bayesian posterior of weights. So yes, I'm,
 I'm sort of convinced. I hope you are too. And they do a lot of they do some more experiments
 right here where you can see that the difference between so this is single model, sorry, this is,
 I guess, here, accuracy, oh, yeah, if you this is the out of distribution test, so you can take a
 data set, and you can corrupt it by corruption. So there are predefined data sets, but you can also
 do it yourself, you crop it, you can do luminosity, whatever, you can destroy parts of the image,
 you can see that having more ensemble members, so this is your original models, here is how they
 sync with increasing corruption. It almost doesn't matter which ones of these methods you do, you see
 the bottom one is the original model, and you gain a little bit by doing these things, but not
 nearly as much by building an ensemble and going here, or actually an ensemble of two members or
 five members, in which case you jump this much in accuracy. So these ensembles from different
 initializations are also very, very, are also very good at countering corruption, which you see also
 here. Yeah, so this is the JS divergence, okay, I've read that, but let's not go here, videos
 already too long. And this is the last thing is on ImageNet test set and the ImageNet
 corrupted set, where they pretty much show the same thing. It's not as pronounced here, but you
 can see pretty much how the different, if you go from single model to ensemble with two members to
 ensemble with four members, there is a general upwards trend, and the general upwards trend is
 much less pronounced within each ensemble, so if you go just go from method to method, then it
 is between the different groups of ensembles, meaning that the ensemble is a much more pronounced
 effect that these other effects. So I hope I have convinced you a little bit of how these subspaces
 look like, how the loss landscape of neural networks look like, especially the fact that there
 are these different minima, and the random initializations of these different groups of
 models, and the random initializations will almost always hit these different minima. And the
 interesting part is that even though these different minima perform equally well, they are
 functionally very different. And an ensemble of differently initialized and independently
 optimized models can actually capture these different modes of the functional space. And
 therefore, if you build an ensemble out of that, it will generalize better, because it kind of can
 draw information from all of those different modes, rather than if you do some sort of Bayesian
 network, which will, because you have to approximate usually with Gaussians, will end up only covering
 one of these modes. That is sort of a good summary of what this paper says. Again, I enjoy
 research like this, because it's easy and it gives, it kind of makes you think, right? So I'll be
 thinking about these things for a while now and thinking of new kind of experiments that one could
 do. And yeah, as I said, this research is still wide open. We don't know so many things about
 neural network. And you know, tell me, tell me what you think is going on, actually, that that would
 be very interesting. And yeah, I'll see you next time. Bye bye.