I'm very happy to welcome Michael Belking to talk to us today. He is a professor at the Halechiolu Data Science Institute at the University of California. And prior to that, he was a professor at the Department of Computer Science and Engineering at the Ohio State University. So, and his research interests are in the theory and applications of machine learning and data analysis. And some of his well-known work are the applications of Lepasian eigenmaps graph and manifold regularization algorithms, as well as polynomial learning of distribution families. And some of his recent work has been concerned with the understanding of statistical phenomena observed in deep learning. And one of the key recent findings is the double descent risk curve that extends the textbook U shaped bias variance trade-off curve beyond the point of interpolation. So without further ado, let's start the seminar. Thank you very much, Becky. And thank you for the invitation. It's very nice to be here virtually. So what I would like to talk about today is some recent issues in really in statistics, which have been identified through the empirical theory through the empirical observations of deep learning. And in some sense, this is a very much kind of physics-minded view. We observe empirical phenomena and we sort of try to provide reasonable theoretical descriptions. So in fact, I've been sort of arguing that we have to do more sort of physics or science kind of based approach to machine learning. Of course, our experimental results done in the computer, but rather than the physical work, but it's a similar setup. Yeah, so by the way, please do interrupt me if there's any questions. I am more than happy to slow down and answer any questions. Yeah, so let me proceed. So, well, in recent years, we have seen that deep neural networks, which very complex objects have performed well on many tasks. And there are really things like this. I think there's very complex structures, have a lot of kind of elements and they are very sort of non-transparent to observation from the point of view of theory. It's not easy to figure out what's going on. And in a sense, we have a sort of crisis of machine learning theory. And sort of on one hand side, there was an argument that machine learning has become alchemy, is a very nice talk by Raheem Ibn-Rack that deep 2017. Well, you're using basically very complex recipes to do things. And sometimes these recipes seem to work, but it's hard to judge when and how they work because there is somehow no systematic theory of the things. On the other hand, machine learning is, like Yaglik would argue, machine learning is theory. He's looking for lost keys on the lamp post because where the light is, right? It was a cartoon of a drunk person looking who lost his keys and is looking for the lost keys on the lamp post. Because somehow it's looking at phenomena which are sort of accessible through the light of this lamp post, but not really where the key is probably lost. I mean, I should point out that there is no sort of a primary reason to think about, you know, the light is fixed, right? So hopefully we can move the light to the China in different direction. But that was sort of the criticism was that the theory was irrelevant to the practice of machine learning. And so what was the kind of issue here? And there are really two issues. If there is a sort of generalization, oops, this is not what I want, there is sort of generalization to the optimization. The first question, which was this very ugly, is why do this very complex over parameterized models generalize? So that's number one. And question number two, why can highly non-convex systems be optimized by methods such as stochastic gradient descent? This stuff will primarily be about the first question, but I'll say something about the second one. Actually, in a sense, the second one is easier. But the first one is perhaps more fundamental for trying to understand what's going on. So I'll talk about the first one for which we have now some understanding, but it's not yet complete. But it's certainly much, much better than it used to be. So what will I talk about this? First, I'll talk about what the issues were sort of standard analysis, and then I'll sort of point out some directions through which we now understand generalization from the theoretical point of view. And at the end, so that's somehow the majority of the stuff, and at the end I'll say something about the optimization. And please do feel free to ask any questions and interrupt. So, okay, so just to set things up, we have this standard supervised machine learning. We have data XIYI, XI, this is a training data, XIYI in RD and YIYI is just for simplicity labels minus one one. And the sort of the goal of machine learning is using this data to construct a new function that best generalizes to unseen data. And what does generalize this mean? Well, actually it's some sort of statement about the future, right? We wanted to predict somehow what will happen in the future, but if you use the CIP plus and the most standard statistical assumption that this data are sampled from some sort of probability distribution independently, then the prediction of the future just becomes that we want the expected value over the future over the unseen data of some loss function to be minimized. And this loss function, you can think of it as maybe a square loss or classification loss. Now, so this is kind of the best, right? This is what we really want. And of course, this assumption. Now, most algorithms and you know, many analysis are based on empirical risk minimization. And the empirical risk minimization is the following. Think you take a class of functions H and you try to find the function which minimizes the loss function over the trading data. And that's the procedure. Well, the procedure, of course, is not just taking argument, the procedure usually has some sort of, you know, algorithmic element, typically just gradient descent type of method. Now, the key aspect of this is actually the choice of this H, right? And how do you choose H? Well, sort of a traditional view of this, is that you do something like this. This is the so-called U shape generalization curve. And the way you do it is you think that if H is small, that is, there are too few candidate functions, then your performance on the trading sample and on the test sample. So this is the red and blue curve correspondingly is not very good, right? So on the x-axis here, you have model complexity. On the y-axis, you have prediction error. So your generalization is not good, right? Because prediction error is on the test sample is bad. If, on the other hand, so that's how they're fitting. If your model complexity is very high, then your performance on the trading data are good, but the performance on the test data is not good because you're somehow overtrading to the test, to the trading sample. And the goal of this is to find the bottom of this curve where the test sample performance is optimized. That's optimal generalization. And the sort of classical corollary of this is that the model with zero trading error is overfade and will generalize poorly. And we will call this zero trading error interpolation because mathematically it is simply classical interpolation. Now, let me sort of, now, so the goal is now I'll kind of outline the sort of classical analysis of the thing and I'll point out what goes wrong with this in view of the empirical alterations. So what's the goal of machine learning? The goal of machine learning, because you will have seen this to find this F star. The goal of empirical risk minimization is to find the F star ERM, right? What's the difference? There are two differences. One is that for ERM, there is this class of functions H. And two is that the sum is taking over the trading data rather than the unseen data. But other than that, it's actually mathematically looks very, very similar. Now, the claim is that the, well, I should say, Vapnik's in book statistical learning theory, he basically said that the theory of induction is based on the uniform law of large numbers. And that effective methods of inference must include capacity control. And that was sort of foundation of learning theory, well, according to this view, Vapnik's view. And let me unfold this a little bit. Empirical loss. So first, what is a uniform law of large numbers? It simply means that empirical loss of any F in H approximates expected loss of F. So this is some sort of law of large number type of statement and it's uniform over this function class H. And second, capacity control just mean that H contains functions that approximate F star. Well, if F doesn't contain function that approximates F, then there is no hope to connect those two. And notice that the goal of learning procedure, right, is to find F star RM, which is close to F star. So if you can connect those two things, then, you know, you're doing well. So it is easy to see that if you have one or two, well, not like immediately, but it's a little bit of collusion, that if you have one or two, then you can connect F star and F star and this is good because that means that your performance of your algorithm is essentially the same as the optimal. So that's machine learning theory. And let me now be a little bit more precise about this. If that the uniform laws of large numbers are actually usually have the following form and there are many sort of different versions of them. But basically on the left of the inequality, you have the expected risk, which is the future. And on the right, you have the empirical risk. And basically with uniform law, large numbers say that the expected risk is bounded by the empirical risk plus some sort of term, which is usually something like of the form of square root of C over M. There are different forms as well. When C some notion of complexity of that function class H. And in some cases, this H can be data dependent. Now, it's kind of nice to call them busy week. What you see is what you get because you see what's on the left is what you get, right, that's the future. What you have on the right, the empirical risk is what you see on your training. So essentially the set that what you see on the training set is what you will get in the future. And the sort of upshot of this is this nice figure from about textbook, which said that it's similar to the one I showed before, but it's a little bit more precise. It shows that on the X axis, you have the size of your class H. On the Y axis, you have the error and the risk. And you have empirical risk, which is the first part of this. So this is empirical risk, right? This is going down as H increases because with more functions, you can fit better. But the model complexity is going up, right? So what he calls confidence interval, which is this model complexity term, this is going up. And empirical risk is going down. And because the bound is composed of the sum, it has this U shape curve. And this is the optimal. So now I've spent some time on this, but to set it up because somehow to make it clear what's going wrong with empirical observations, we have to sort of fix the idea of what is to be expected. And now here are some really interesting observations. And I think in this paper by Zhang Litao from this, which is called understanding deep learning requires rethinking generalization. The case that they make the case that you can trade a neural network to have 100% accuracy. So it's perfect. It fits the data perfectly. And yet the test accuracy is still quite good. So if there is overfitting, it's not large, right? They get almost 90% test accuracy, which is pretty remarkable. They use some sort of neural network architecture. So this actually suggests that interpolation that is fitting the data trading data, exactly it doesn't overfit or at least doesn't overfit much. This actually I should point out is not a new observation. And in fact, in 98, there was a well-known paper boosting the margin by Shapir, Freud, Barclay and Lee. And they analyzed boosting and sort of the whole analysis based on the observation that the test error of generated hypothesis, I'm quoting from this, usually does not increase as its size becomes very large and often it's observed to decrease even after the training error reaches zero. So it's exactly this phenomenon. So even after the training error, well, classification error reaches zero, you still get better performance. So this is probably was observed in early 90s, this kind of phenomenon on mid 90s. For the, well, I don't know for the first time or not. Okay. Now, let me point out that this is suggested but doesn't directly validate these weak points because well, we don't know what the true accuracy should be. And maybe the true accuracy is 100% and then maybe data totally separable. And then of course, this is not inconsistent with this ball that we have. So how do we test model complexity? And let me sort of give you an experimental setup. So it's kind of physics-like experiments. And there is actually a simple sort of test model when we can test model complexity and the idea is to add label noise. So let me just tell you how it works. So imagine that I have two data set with two classes and suppose my classes are actually linearly separable like here, right? So there is a line and the line separates up perfectly. So the test error should be zero for the optimal predictor. Now, what if I do the following? So notice that interpolating here is okay, right? Because the slide interpolates, right? On everything to the left, I'll call red and everything to the right, I'll call blue. That's my interpolation. Now, what do I do? Well, I can add label noise. And what do I mean by label noise? The easiest way probably to do it is just to flip some of the labels. So I dig thick 10% of the labels and I flip them. So at random. So you can see I flip this two and this one, okay? Now you can see that if I am to separate the red from blue, it's going to be a very complicated boundary. I need to have something like this. So I don't know. Okay, I'm not doing a great job, but you can see that the model complexity required to interpolate this data now is dramatically higher than it was for the line, right? So somehow by adding label noise, I'm forcing the model complexity of the interpolating model to increase dramatically. And presumably that would require the model to overfit. But notice, however, that the optimal model does not change. The optimal is still here.  It's just that some labels get flipped as long as the flip is less than 50%. So this is interesting because you can see that there is kind of a big gap between the labels. You see that there is kind of adding label noise, create this somehow it causes the optimal model and the interpolating model to diverge, right? One is very simple, the other is rather complex. Okay, so, and sort of theoretically what we expect is that overfitting will become bad as a model complexity ground script. But let's see what actually happens in practice. So this is an experiment which we did with my students, see you on mind to make Mandel, curious experiment. So we took, this was on, I think on the MNIST which is a 10 class, 10 written digit classifier. So it's 10 class. So on the X axis, I have the label noise. So we're doing more and more label noise on the Y axis. I have a classification error. So notice that zero classification error is great, right? It's the best and 90% classification error is random since it's a 10 class problem. Now the green line here is the third of the theoretical optimal, right? Because when there is no label noise, you kind of do better than 0% and you can see that when adding noise, it's actually just a line connecting at 100% label noise, right? It's a completely random prediction. So it's a line connecting zero and sort of the left corner of this and the right corner of this. Now, what am I showing here? I'm showing several methods, but in particular, you can look at the Laplace kernel because it's kind of the nicest curve here. And if you're not familiar with kernel machines, it doesn't really matter what it is exactly. The important part of it is that it's a method which fits my training data exactly. And by exactly, I literally mean exactly with zero training square, well, it's not technically zero, but it's like machine zero, 10 to the minus 25, something like that, very, very small. At precision level, essentially. You can do something similar with neural network, but with neural network, so with a kernel machine, you have an analytical solution by matrix inversion. With neural network, you have to train it so it's not possible to get quite such a low error, but you get still something quite small in square loss and you get zero in classification loss. Okay, so that's basically what I have. And now we observe a pretty remarkable thing here is that even when the label noise is quite high, right? Like it's 70%, the classification error of my Laplace kernel machine is maybe only 5 to 8% worse than the best optimal. And that's pretty remarkable because think about what it's doing. It's fitting 70%, so 70% of my points are junk, right? There is no, I'm fitting tremendous amount of noise, but yet I'm paying for it very little. So there is very, very little of our teaching. So that seems somehow difficult to reconcile with the bounds that we have seen before. And let me sort of be a little bit more analytic about why this is difficult to reconcile. So what was about that we had before? We had this type of busy week bound and the question is can uniform bounds like this? It's called for generalization of the interpolation. And the question is, well, on the left, you have test loss, right? And in the presence of noise in my data, the test loss is actually not equal to zero. The training loss, however, is equal to zero. So this part disappears. And now the test loss needs to be exactly bounded by some sort of model complexity. And this is quite difficult. And why this is difficult is, well, let's think about what this fits. So if you look at a high noise level, like 80%, then you see that the test loss, like to explain what we see, right? The test loss would have to be bounded by 0.7 on the left and 0.9 on the right. Like why? Because you see on the right, if it's bigger than 0.9, right, it's useless. Since it's not telling me anything better than random. If it's smaller than 0.7 on the left, that's better than the best possible. So that's impossible, that's wrong. So that's basically what it is. So you have to have it in this very narrow band between 0.7 and 0.9 to be both correct in use. And the problem is that this is very difficult to have a bounce like that for any sort of realistic scenario. Why? Because, well, there are like constants here in all star. First there are constants, right? And even the constant factor of two will already break this bound. And there are a lot of factors that there are all sorts of other things. So there are really no bounds like that. Oh, okay, I should moderate this slightly. So in some very special cases, actually, they could be bounds which are almost exact like for linear regression with Gaussian terms. And actually recently there was a nice work by from the netis-rebras group they analyzed. They showed that one specific example where this is possible. But thirdly, you wouldn't expect such a bound to exist in general. And it was kind of conceptually, how would the quantity see off and how would model complexity know about the base risk? Because somehow it has to know about this left mark. And that seems difficult. So there was actually some recent work in particular in the garage and in Colt and Barclay did a lot for show that in some, for some kind of general cases, such bounds do not exist. So that's basically maybe a summary of the crisis that we have for generalization is that the observed phenomena of deep learning seem to contradict to get out what we would expect it to be. So theory and experiments do not fit. And now you could say, well, if this really the sort of, maybe this is some sort of marginal thing, but really in some sense, you can say that interpolation is best practice for deep learning. And I really liked this quote from Ruslan's tutorial. He said that the best way to solve the problem from practical standpoint, you build a big system and basically want to make sure you hit zero trading. So you really want the system which interpolates. And now, well, if you want to get state of that result, this is not the end, like you do other things to the system, but if you already at this point, when you get zero trading error, it already works okay. So you already have some generalization. And really the practice of machine learning has been building bigger and bigger systems. And this is a summary from 2017 of the systems different architectures. So each circle here corresponds to an architecture. The small ones are about 5 million parameters. The big ones is about 150 million parameters. So the one I showed you on the first slide is actually a small one. It only has about 6 million parameters. Now, that was 2017. In 2020, we have GPT-3 with 175 billion parameters. This is to scale. So the area of a circle corresponds to the number of parameters. And well, in 2021, there is something called Switch Transformer, which has trillions of parameters. And by the way, you can see this other architecture, they're all here. So they have been this kind of freelance, relentless growth of the number of parameters, this extremely, extremely large system. Although arguably you should say this, they also trade on very large data sets. So they have been sort of historical recognition of this. And well, Jan, of course, on many occasions has something like deep logic breaks on basic rules of statistics. Remarkably in 1995, Leo Breiman, a statistician from Berkeley, he wrote this very interesting note called Reflections After Referring Papers for NIPPs. And he asked several questions. And the first one was, why don't heavily parametrize neural networks overfeed the data? And what was really kind of was clear to him in 1995 that there were some sort of issue. So that's maybe the summary of empirical findings. So that's a nice sort of, that's kind of a way to summarize this. The goal of optimization, which is simply interpolating or minimizing empirical laws aligns with the goal of machine learning, which is minimizing the expected loss. And I think this is truly, I think, unexpected from a classical statistic point of view. Because traditionally, we use some sort of capacity control or similar ideas based on regularization and so on. So that's basically that's maybe the summary of the sort of the meat of this crisis of generalization. And yeah, are there any sort of to summarize as a theory that if we want a new theory of induction, which we do definitely want, it kind of be based on this kind of classical uniform lots of large numbers with capacity control. And the question is sort of what's next? Any questions? I'm more than happy to sort of, maybe this is a nice point to sort of take a short break and see if there is any question. Yeah, I see Brink has a question. Hi, yeah. So you mentioned this paper earlier, the Bartlett paper on boosting the margin. And there's some of these sort of interpolation you're not overfitting things are seen in that sense as well. I'm wondering if there's a lot of been much work in studying boosting as an analogy for deep learning. At the moment, because it seems like most of it after the whole NTK thing is concentrated around the beaches and kernels. I'm wondering if you think there's like stuff to be understood about deep learning from looking at boosting. I haven't said that's a really, that's an interesting question. So I think that there was a lot of study of boosting early on in like late nineties and early 2000s. And I think there was recently much less. Yeah, I don't know why. Yeah, so my impression is that there haven't been as much study. I mean, the thing with NTK is that this gives a very direct connection to between kernels and neural networks, which I guess is not the case with boosting. Yeah, that's an interesting question. I should point out that boosting is still used very widely like what is it called? HG boost, right? That's some form of boosting. That's like one of the most popular methods. Like if you look at Kaggle, that's like very, very popular. But probably not used as much to analyze deep learning. Yeah, and that's a question. Are? It's, I have a question. It's more of a historical question about the Zangetal paper. Mm-hmm. We know that neural networks are highly expressive, right? There's lots of, so it's not all surprising that if you make a big neural network, you should be able to get zero training error. We also empirically that they journalize well, doing that longer than Zangetal papers. So I was, I know this, the one question maybe it feeds a comment on is why has this, why was it this particular paper that so much caught everyone's imagination? In the way I read the papers, more something like this, which is saying, what it really shows is that SGD is a very good optimizer because they're able to get, find the zero training errors on randomly labeled data. But I was not surprised at all that they could find those solutions because they're highly expressive. That's right. So in some sense, it is perhaps not surprising, right? Because, okay, yeah, there are like tons and tons of parameters. Why shouldn't you be able to fit the data? But I think the fact that- There are proofs, right? There's expressivity proofs. Sure, there are expressivity proofs, but I think what you say is correct. What is not obvious is that this kind of gradient based method can do something because, yeah, the proofs are kind of very generic, right? They're just saying that some class of functions is big. But why would SGD find something like that? You know, the analysis are convex in the classically and this clearly is very, very non-convex. So I think that was maybe the kind of, the surprising thing is that non-convexity doesn't matter. And they really systematically showed it very nicely as it's like ending noise and writing this. So that's somehow caught the imagination, I think. I think that was a kind of historically very significant war. Okay, so let me maybe continue if there are no further questions. Yeah, so what's, if your theory of induction can be based on this, well, where next? Then I think actually it's kind of pretty remarkable in retrospect is that one nearest neighbor classifier, right, one nearest neighbor is probably the most classical predictor, certainly one of them is linear regression. And it has a, first it's in the interpolating classifier, right? Because one nearest neighbor interpolates. Second, it has a non-trivial and sharp performance guarantee that it's twice the base risk due to covering 167. They actually, they prove more than that, but this is one of the things. What I say twice, it's actually, there is a more precise thing, but it's bounded by twice. And it's not explained and as Pfizer now never was explained by empirical risk minimization. So sort of in retrospect, it's kind of interesting because we sort of thought of the Lapdic's theory. Lapdic's claim that this is the theory of learning is reasonable, but yet it doesn't explain this very simple algorithm, right? One nearest neighbor can be simpler. So there were some sort of disconnect between this which sort of went unnoticed. And actually, you could, so twice the base risk, maybe it's still kind of far from optimal, but you can push this. And there is a very actually interesting this kind of singular curvil interpolation scheme which originally was known as shepherd's, what was to know the shepherd's interpolation. And there was a remarkable result by D. Roy, Dior, Fiat, Kruzhak, I probably not saying the name correctly. In 98, when they showed that for a second curvil, this scheme produces, it's consistent for regression. And the scheme is this kind of classical kernel moving the D. Roy Watson scheme. So just give it by this equation, but using a singular kernel. So the kernel has a singularity, it has a pole. It has something like this. In any case, you can actually push this more and we showed, so with Daniel, so in part of the trend that there was a follow-up with Sascha Rakti and Sascha Tsibakov, that in fact, there is kind of, if you're allowing this nearest neighbor type of scheme with this weight, you can actually have a class of the singular kernels. And in fact, you even can get optimal rates and so on. So you can essentially get statistically optimal predictors which is pretty strange because they look crazy. And that's what they look like. So I think the picture on the right is, though you have data, which is just one dimensional, and the true thing is Y plus X. So it's Y plus X plus noise. And what you have, you have this data and so the blue line is optimal prediction. The red curve is what you get from one of these schemes. And you can see that at every data point, this red curve is not close to the line. So if a priori, the blue line is impossible to get, it's the best. At every point, this red curve is not close to the line, but yet when you get enough data, somehow on average, it will converge to the blue line and it will become optimal. So it's a very weird, it's a very weird sort of non-intuitive kind of predictor. And what it seems, and in some sense, you can quantify that in high dimension, that becomes even easier for it to be optimal. There is some sort of leisig of dimensionality here. But even in one dimension, it's optimal in the speedy box, so that's what you get. Now, yeah, so as you can see, this is kind of a very counterintuitive from a traditional point of view, because it just looks strange. And maybe I'll keep this adversarial examples. So here is what we have so far, is that interpolation empirically aligns with generalization, that's empirical observation. Second theory of interpolation should not be based on uniform bounds. And there is at least some methods like this nearest neighbor interpolating methods, which have statistical validity. Now, there is a mismatch obviously between A and C because there's nearest neighbor type of methods, like one nearest neighbor. They have no capacity control, complexity control and they have no optimization. Yet, practical methods always use optimization in some sense use the largest sort of feasible models. In some sense, you build a model which is based on how many GPUs you have. Google have like 10,000 GPUs and they build a model with trillion parameters, something like that. So the key question is dependence on generalization of model complexity. And in particular the number of parameters because that's, I mean, you can argue that the number of parameters is the right measure of model complexity, perhaps it's not. But it is the thing that we observe, right? When you choose a model, that's what we have. You have the number of parameters, you don't have spectral norms, you don't have this more complicated things. And this is sort of where the double descent curve comes in. And if you sort of see the standard curve which is on the left, you'll have underfitting and overfitting, right? And as you increase in complexity, you go through the few curve. And then the question is, what happens if you increase your complexity even further, path, the point of interpolation? So at this point, the model is complex enough to fit the data exactly. And the performance actually is not good. But as you're increasing the model complexity, it turns out that all of these models to the right are interpolating, but the larger model actually generalize better. And that's what we call the double descent because there are some called as two. Oh, and this is what joint work with Daniels who see you out by it's a bit of a doubt. And yeah, so there is the kind of the classical descent and then there is this modern descent. And the interesting thing is that the modern descent often goes, often, but not always goes to infinity. So the more parameters you have, the better your performance becomes. So of course it doesn't go to zero, right? The risk never goes to zero, but it monotonically decreases in many cases. And often the bottom of the few is actually higher than the point of the right. So very complex model can outperform classical models. That's what we observe, which is, you know, and that's what people in deep learning have been observing. That was kind of the impetus for building such large models. And yeah, so there have been a number of different observations of this type of things. Maybe let me skip this. But let me maybe, I don't have a lot of time left, but let me maybe say a few words about what is the mechanism for that? And let me just take a very simple model, which is this random radio network. So you have two layers and you first, the first layer is fixed, it's just random. So you can say it's a random radio feature model. And this is what it works, what it looks like. So I'm just doing it in one dimension. So if you have three neurons, you have this kind of nice parametric fit. You just have this nice curve. So I have, I think 11 data points in one dimension. And if I increase the number of neurons, and I have 30 neurons, I get some sort of classical overfitting, right? I fit the data, but it looks awful and probably has no generalization power. It kind of oscillates all over the place. And if I increase the number of neurons to 3000, this actually becomes a nice non-parametric model. Now, the model is non-parametric, of course the model is technically parametric. It has whatever, 3000 parameters, but it's not parametric in the sense that it's close to the limits. Like if I take 3 million, it would essentially look the same. So it's pretty nice because what you can see is that as you increase it up of parameters, you go from parametric models to some sort of bad overfitting to non-parametric models. So you can combine both in the same kind of axis, which is, I think that kind of bodes well for having some sort of theory potentially, although we don't have that yet, but no, not complete. Okay, maybe I'll keep this. You can do this. Yeah, maybe one point I would like to sort of say if that as you increase the number of features, it's a similar model, but I don't want to discuss what it is. What you can show is that the norm of the predictor, it kind of increases with the number of features. Initially, and then it decreases again. And that's because, you see, when the number of features is actually equal to the number of data points, you have a unique solution, and the solution is usually awful because you have to fit noise. But when the number of features much larger than the number of data points, you have many solution which fits the data. And if you choose the medium of norm solution, it has some sort of desirable properties. So more features or more of a parameterization allows you a bigger space to choose your inter-politic solutions from. And among those solutions, there are some which are good. And it happens that the minimum norm solution is all, is not always, is frequently good. That's basically, so more features somehow allows you to give you a better approximation to the true minimum norm solutions. So very briefly, that's what it is. And let me just pick this. So they've been quite a bit of work on trying to understand this in particular for interpolating linear models and for a random features model. There is actually recently a very nice work by Hulse Miller, who showed that there is a lower bound on the number of features. So P, so if you look at the bottom, okay, it's, ah, what's going on? Why is my, I cannot, for some reason I cannot draw. In any case, look at the absolute noise, that's a lower bound on the loss. And P is the number of features and N is the number of data points. And it basically says that when P is close to M, this is quite large. So you have this peak. But when P is much larger than N, this goes to zero. And the lower bound, well, it doesn't tell you about the upper bound, but you can have very good predictors. And the nice thing about his result is that it's quite general. It's essentially a work for any model. Okay, so let me, I am almost out of time. So let me actually just do a summary. And then I want to say like one word about optimization. So to summarize, you can kind of think maybe as a framework for model machine learning is some sort of Occam's razor. And what you would like to say, you would like to maximize smoothness, subject to interpolate the data, what do I mean by smoothness? That could be some sort of averaging process. Or this could be, and I didn't really discuss the averaging very much. Or it could be some sort of medium of dorm solution. So, you know, like when you have like a lot of random features, this is some sort of self-smoothing process. And there are really three ways to increase smoothness. You could look at this functional dorm solutions like exact kernel machine. So maybe approximate with random features. You could do it for optimization implicitly. And we understand this for again, for this type of linear models and parameters or random feature type of models, not so much for neural networks in general. Or you could do averaging, like bagging or boosting type of processes. Well, boosting is somehow a bit bit. And interestingly, all of these processes, all of these ways coincide for kernel machines or there is something quite nice about kernel. Okay, so that's all about generalization. Now, maybe just one point here is that, I think the nice thing about it is that overfitting kind of shows in the different light in this curve is that overfitting really is a band of parameters around interpolation threshold. And you can combat overfitting by decreasing the number of parameters or by degrading regularization or by increasing the number of parameters and essentially building bigger systems. Now, let me, given that I don't have time, let me just point out something quite interesting about landscapes of over-pervitrized models and why neural networks seem to be not too difficult to optimize. Well, the landscapes, of course, are not convex. And, you know, like in a classically, we think of dot convex is something like this, which is terrible, right? We have to find anything by gradient. They said, oh, rather we can find some local medium, which is probably no good. But this is actually a rather misleading way to think about over-parameterized system. And really you need to think of over-parameterized system or something like that. So the landscapes have this manifolds of minima and every minimum is a global medium. And you can see that on the left, gradient descent will not work, right?  But on the right, a ball, if you roll a downhill, it will actually go to a global medium. So this is a kind of benign landscape, even though they're non-convex and they're actually non-convex in a very strong sense that they're locally non-convex at every point. As long as this manifold of minima has curvature, basically they're always non-convex. So this can be analyzed and we argued that there is this kind of classical idea of polyacrylate savage, this condition, which we argued that the over-parameterized system satisfy that. But let me stop here. And yeah, so this is maybe the kind of summary. So you have these classical models and you need careful parameter selection here and there are many non-global minima and you have issues with optimization. And there are these modern models and essentially with modern models, you could just take models to be quite large. And you don't need a lot of regularization and your gradient descent method converts somehow more or less for free, which is pretty remarkable, probably what makes deep learning possible to a large degree. So I'll stop here and I'm very happy to take any questions. Okay, thank you very much, Mikhail. Any question from our audience?


Here we are in our example Form 1040 populated with LASERT tax software. You don't need tax software to follow along, but it's a great tool to run scenarios with. You can also get access to the Form 1040 related forms and schedules at the IRS website, irs.gov, irs.gov. Starting point, as usual, single filer Mr. Anderson, no dependents, 100,000 W2 income. We've got the 12,950 standard deduction getting us down to the 80,050, 87,050. Page two, calculating the tax line 1614774, starting with the $15,000 withheld getting us to the 226. Now we're focused on page one, however, the calculation of taxable income. And we're focused on the standard deductions and the itemized deductions, focusing more on the itemized deductions, which normally you wouldn't be taking the itemized deductions unless they add up to more... Point deducted. ...than what is on the standard deduction 12,950 for single filers 25,900 for married filing joint. However, when we're looking at federally declared losses, for example, or qualified losses, we could have a situation where the standard deduction isn't being cleared, but we're using the Schedule A to still get a benefit, even though we would in essence be taking the standard deduction, which you would think kind of makes sense if people had it like a disaster that would happen. But it's a little bit of a weird situation. So let's take a look at it now. If I open this up, we're going to go down to the Schedule A. So if I scroll down now, normally the thing that kicks people over to itemize are owning a home, which includes the mortgage interest on the home and the taxes that kick people over the threshold, possibly, or the most likely thing to kick people over the threshold to be itemizing, and then all this other stuff kicks in. We're focused down here on the casualty and theft losses. Now, this used to be a more expanded category. If you remember a few years ago, they've limited it a lot to, as you can see here, casualty and theft losses from a federally declared disaster, from a federally declared disaster other than net qualified disaster. So we have to attach form 4684. Now, the thing that's funny is that if it's a federally declared disaster, my interpretation is that you can basically level it up from there to a qualified disaster, in which case it would be more beneficial. There's a big difference between those two designations. And if it was a qualified disaster, it'd be pushed down here in essence to the other itemized deductions. And in that instance, even if you're not itemizing, you might get a benefit because it'll basically add in the standard deduction over here. So we'll still use the Schedule A, but you could get a benefit even if you're taking a standard deduction. So the bottom line is if you're thinking about these like a disaster that happened, you want to know the current location you're at, the disaster that possibly could have happened in that area that you might have to be dealing with, get more information on the IRS website related to it, as well as FEMA website, and then realize that even though it's going to be kind of pulled into the Schedule A, you might be in a situation where people that are not itemizing would still get kind of a benefit from it due to the calculation. Also note that if the disaster happened, you might in like 2023, for example, you might be able to choose whether or not you can take the loss in the year it happened, in that case 2023, which means you wouldn't actually file for it until April 15th of 2024, or possibly you might be able to take the loss on the prior year. So if it happened in 2023, we might be able to take the loss in the 2022 tax return, which if you hadn't yet filed that tax return, you could file or possibly if you had already filed it, you might have the option to amend the tax return. And in that case, you might get a bigger tax benefit if you take the loss in the year that the disaster didn't actually happen, because the year in which the disaster actually happened may have resulted in your income being a lot lower than it otherwise would have been. And because of the progressive tax system, you might not get as big a benefit from a deduction in the year with a lower income. Okay, so that said, the difference between the declarations, I'll just give a quick recap here, limitation on personal casualty and theft losses, personal casualty and theft losses of an individual sustained in a tax year beginning after 2017 are deductible only to the extent that the losses are attributable to a federally declared disaster. Okay, so personal casualty and theft losses attributable to a federally declared disaster, A disaster, a horrible, horrible disaster, are subject to the $100 per casualty and 10% of your adjusted gross income limitations. That's a big limitation even though they're federally declared disaster unless they are attributable to a qualified disaster loss. So now we've got this qualified disaster loss becomes important. Personal and casualty, theft losses attributable to a qualified disaster loss are not subject to the 10% of AGI limit and the $100 limit is increased to $500, an exception to the rule above limiting the personal casualty and theft deduction and losses attributable to a federally declared disaster applies to you have a personal casualty canes for the year. Okay, so it's important to kind of get the designation correct in other words and then we could have it then be applied to one of these two items. Let's first take the first kind of designation which is the less tax beneficial designation.


So I just finished watching the fight and I'm glad I didn't pay for it. I feel sorry for all of you that did pay for this pay-per-view You got scammed. You got duped They stole your money Simple as that. I feel sorry for people that actually went to bars and club Clubs and paid extra money because I'm sure they charged a cover fee for you to watch this fight You got scammed you got bamboozled Me I watched this for free and at some point in the middle of the fight the stream went out And then when the stream came back on I didn't really miss anything They were literally doing the same thing. They were doing at the beginning of the match Towards the end of the entire match The first round Logan trying to fill out, you know Mayweather and Towards the end of the round. He he started just throwing just these flurry of Just punches. He's just thrown them and none of them were really connecting Like none of them were actually connecting Floyd doing any damage Second round came out gassed And then I want to say round the third round for me. That's when my stream went out I didn't I wasn't able to catch it into the fifth round And they were literally doing more or less what they were doing in the first few rounds where I was watching There was some holds going on Uh, Floyd was catching him with a few stiff ones. Obviously so And Logan was trying his best There's one thing I will give Logan I give him heart because he lasted all eight rounds with Floyd But to be honest with you I think a lot of people were hoping for a knockout And I think a lot of people were paying for a knockout So you can hear audible boos When they were just pretty much hugging each other and it wasn't even really Floyd that was hugging it was Logan because he has a height advantage and weight advantage He would literally tower over Floyd and just hug. That's it. Just hug Anytime he was getting gassed, which he was pretty much gassed throughout the entire match hug It was it got to the point where it was frustrating me and once again I didn't pay for this stream, bro I literally Watched it for free and I was getting irritated like I paid for it because the later rounds they were just hugging each other Mainly just Logan hugging because he's gassed You can tell your opponent's gas when they're not even guarding like this They're guarding like their hands are damn near to the waist to the you know their sides They're not really guarding because they're tired like this was This was a waste of time, bro. I'm gonna be honest with you I was somewhat intrigued because of the pre You know fight antics, you know a few weeks ago I rather it had been Jake in the ring and know what's crazy. They cut to Jake middle of the fight In the crowd and he's talking to the camera like Yo, I got Logan up three two right now three two rounds right now Like can you believe that logan's up right now? No, he wasn't he was never up He was literally never up. They showed the card percentages of punch punches landed Floyd's in the 50% range Logan's like in the 12th like it was I mean, it's what you expected, but I think What really got people is those last few rounds where it was just hugging bro That's what the match was hugging So if you paid for this I am sorry I am sorry. No one told you not to pay for this Like I am sorry. No one told you that this is not worth your money Hell I made a video earlier today Talking about I would the most I would pay for this is $10. I take that back the most and I mean I'm being this is here the most I would pay for this fight knowing what I got now The most I would pay dead ass Most I would pay Is nothing I wouldn't even pay a penny for this I would keep that penny that could be a good luck penny. I wouldn't give away a penny to watch this goddamn shit again, bro This was yeah I am so sorry and I know people paid a lot of money to actually go sitting that arena To watch those other fights to watch this fight and to just be Just disappointed in both the guys there.  You're happy.  He just got millions of dollars richer His name is going to be all over sports center Shows and and new shows are going to be talking about him His brand just went up because now he could say I went in the ring with one of the best boxes to ever box and I stood my ground and I didn't fall Because an expert I can't even talk an exhibition match can only end in a knockout So it's an exhibition match. So it's going to automatically be a draw They're going to count the punches and you can view from there and judge from there But an exhibition match only ends in a ko or if the the Referee stops it. So yeah There we go Ah That's crazy, man. I oh, yeah, I I can't I can't believe So many people got okey doped and I had a feeling That this could possibly happen.  Check out next time. Appreciate all the love support roll to 50k and I'm out


theCUBE presents Dell Technologies World, brought to you by Dell. Hey everyone, welcome back to theCUBE's coverage of Dell Technologies World 2022, live from the Venetian in Las Vegas, Lisa Martin with Dave Vellante. This is day two of theCUBE's coverage. We've had a lot of great folks on, talking about multi-cloud, partner ecosystem, SaaS, et cetera, the last day and a half. Now we're going to have a conversation with Dell and Deloitte. We've got two guests joining us. Please welcome David Lenthicum, the Chief Cloud Strategy Officer at Deloitte and Brad Lewis, the Senior Vice President at GM of the Global Transformation Office at Dell Technologies. Guys, welcome to theCUBE. Thank you for having us. Thank you. Hey guys. So lots to talk about multi-cloud. You can't, it's one of the biggest themes here. David, I want to start with you. One of the things that Michael Dell said in his keynote and he said it on theCUBE today is, it's multi-cloud world by default. What does that mean to you? What that means is that if you don't find multi-cloud, multi-cloud is going to find you. It's a complex distributed system that basically is invasive to what we do within the enterprise. So anybody who's leveraging cloud computing is going to find that there's a need to leverage multiple clouds and multiple kinds of technologies. And therefore we're kind of focused on what's in and between the clouds versus the clouds themselves. And I think that's okay. We're leveraging multi-cloud by choice. It's driving innovation, it's driving agility. That's why people are adopting it. So whether or not you have it or not, within your enterprise, chances are you do or you're going to have it pretty soon. Right, I think a stat I saw yesterday was 75% of organizations have at least three to four different clouds. What is your take on when you're talking with customers in the field, how are they managing that approach? What are they doing right? What are they maybe not doing right? I think what they're doing wrong, main labels, hit that one first, is that they're managing their clouds within the silos. And so in other words, they're using whatever native tools are in the particular cloud provided to do operations, do security, do governance, things like that. And the reality is it's a more holistic approach that needs to be taken. We need to span these solutions across the different cloud providers and also the existing legacy systems. Thinking holistically about that is just something we haven't done ever within IT and now we're having to do it. Brad, what is the global transformation office, Del? What's your role and your mission? Sure, so our mission is working with our customers who are really focused on driving outcome-centric types of relationship with us. So worried less about the tech just in and of itself and really wanting to figure out how do I take advantage of all of those capabilities that Dell and its partner ecosystem have to drive business value ultimately? What does a great experience look like for their developer? For my lines of business, how do I start to improve the type of agility that I've got? How do I offer some of the types of flexible platforms that I'm really reading about or aspiring to be able to offer? So being able to look at that holistic through the lens of technology, the economics of that, the operational constructs and operating models around it and being able to really take all of those assets and capabilities and map them to the types of outcomes, milestones and timelines that are relevant to that. Who's your ideal partner at the customer? Is it the CIO, the line of business, somebody in infrastructure? It's all of the above. I think as we get through the conversation, model become apparent is tech is part of the answer. So it's important. It has to be considered. It has to be architected well. It has to be operated well. But as important as tech and increasingly more so is to David's point, how are you going to go and build that common model of operational construct around all of these different platforms so you don't end up with a silo-based approach? Application owners and driving utilization and adoption is important and more so than it's ever been. So having those line of business that tie-ins and the application owners, all of those different stakeholders finance and being able to set expectations well and being able to deliver against those consistently and reliably and the impact that has and confidence and investment. All of those things become part of a fabric of a collective that's about mapping to those. So there's no one set of stakeholders that we work with, but what is really important is having somebody who sits across all of those things that has the ability to call the shots and make decisions when hard decisions aren't having to be made because where things don't typically work well is when we get into stalemates or standoffs where there's different factional issues or politics comes into it or somebody's not empowered. Having that governance model so that there is a senior stakeholder who can move roadblocks and make sure that we remain aligned is one of the most critical factors. David, a question for you. Removing those roadblocks. The last two years, obviously, we've seen a lot of organizations massively pivot multiple times to survive and not to thrive, but we've seen so much investment in the remote workforce and now a lot of businesses facing aging infrastructure. What do we do? How do you help them remove those roadblocks? Obviously, time is of the essence, right? So from a competitive perspective, what are some of those conversations look and sound like? Well, number one, get the obstacles out of the way. In other words, if you think this is about building more data centers to have more VPN traffic and things like that, that's not what it's all about. This is about finding solutions that provide scalability within the organization and it's going to maintain scalability. Keep in mind, we're running to a workforce. People are going to work interdependently. They're going to exist on their own infrastructure. They're going to have their own data which is personalized to them. They're going to basically interact with other employees and other coworkers in different, more collaborative ways, hopefully. So the idea being that we're trying to get everything back centralized again is crazy. We need to figure out ways in which we can diversify the workforce, diversify the kind of technology we're using and leverage things that are really kind of on-demand and scalable and quit thinking about building data centers. Okay, so square this circle for me because I totally agree with what you just said but it seems like a lot of organizations, when it comes to data, aren't taking that approach. They're like, okay, let's centralize all the data so we can make it more manageable and more efficient to manage. Yet, we talk about edge. Data is distributed by its very nature. So help me understand that Yin and Yan. I think it's partially, we get into obviously the governance and the data governance and sort of all of the regulatory and compliance aspects of that. Part of it's also emerging technologies. It's the area that's probably the least mature. We spend a lot of time figuring out how to have operational tool sets around multi-cloud. Then we figured about how to have applications traverse multi-cloud. Now we're moving on to the real crux of the problem and especially as trends like edge start to take hold. We're generating large volumes of data. It's being generated at the edge. It's being generated in the core and that ability to look at things holistically is going to become increasingly important. It's an area of focus for obviously us at Dell Technologies. It's where we're investing heavily from an R&D standpoint. It's where the marketplace is going to evolve but it's still in an early stage of maturity and being able to look at that holistically. So not necessarily shove it all into a single data store but enable it to be distributed and managed and governed. Who should own the data lifecycle? Yeah, should it be somebody in the business? Should it be somebody in IT? Should it be the data group? It's, now there's a long, how long have we got? Well, I mean, you must have these discussions with it. We do. We absolutely do. But sort of being serious about it, I think the important point is the people who ultimately are the ones who are responsible for getting value from that data is where it should reside. So because they're the people who have the greatest insight and understanding of how to really get value from it because ultimately we want to pivot from having a data conversation to how do we generate information and actionable information? It's not a data problem in and of itself. This is a business intelligence. How do we get value from this? And the best place for the data to live is the people who are going to be able to make the most of that. So Deloitte's got to be having these conversations all the time with your customers. But this is an organizational discussion, isn't it? It's also a functional discussion. You have to remember that there's two tiers there. There's the people who own the data tier but don't necessarily want to administer the data. So they know what the data is, what it does, they control how it's changed, they control how it's monitored and we have multiple people that are distributed all over the company that do that. And then there's the people that actually run the control plane. And we get to distribute the data. We're having to get to a common control plane that goes across the various databases which is able to make the changes to the metadata and changes to the technical geeky stuff we have to do to keep the data running. And so it's okay to have that. It's okay to have non-technical and technical users who still maintain ownership of the data and they work together in kind of a DevOps situation to make sure that we're maintaining the data to the needs of the business. And we have the business owners in there to tell us what that is. And we have the data administrators in there to actually make the changes. So the technology is an implementation detail in that model that's not, it's not the tail wagging the dog, it's subservient to the business essentially. They're working together. And the reality is that the people who have the technical know-how and have the business know-how are often sitting in two different organizations that can't exist anymore. They need to be maintained. They need to remove the barriers. And I deal with this with my clients all the time. They can't sit in silos. They need to collaborate together to make sure that the systems and the data are going to reflect and to solve the needs of the business. The only way to do that is to have collaboration at that level. So Lisa referenced multi-cloud by default. Chuck Whitten was talking about that on theCUBE recently. So I have often said multi-cloud is really multi-vendor. Like, ooh, I woke up, I got all these clouds. Okay, so what are the right strategies for customers? Where are they starting? How are they thinking about it? The people who are making the best progress is looking at it holistically, looking at what does good look like? What are the things that are important to us? What are the capabilities we're wanting to offer up? And going into things worried less about the tech of it, but more about how are we going to do things like accelerate business agility? How are we going to start to empower our business, the lines of business to have first mover advantage? How do we take advantage of all of these disparate capabilities that in an overtime it's going to vary who has competitive advantage. You could have one provider comes up with something that's a really compelling use case for what you're looking to do. But so if you've got the ability to be able to consume as a consistent ecosystem all of those different partners, it's very easy to tap into that quickly and effectively to leverage it. If you're trying to build things so that you're only tied into different people in different ways with different operational constructs that don't really talk very well together, it's going to become very difficult for you to really take the maximum advantage of multi-cloud. So the thing that I would stress is what are you actually trying to accomplish out of that? Work from the top down, think about what good looks like, what are the capabilities that are meaningful and impactful to the business? And then the easiest thing in the world is to figure out which technology choices you have that enable that. But it has to be done through that lens of what does business value look like and how do we manage that and maximize that versus making disparate sort of distinct technology choices. With the focus on business need, which is absolutely critical, David, what's the GTM like between Dell and Deloitte? When do you bring them in? It's a perfect relationship. You got to remember the customers and our clients have to have two things. Number one, they have to have a trusted advisor and someone can bring to bear risk, financial analysis, ability to deal with technology, data, security, governance, things like that, which are hard problems to solve, but do so in an objective way, making sure we're bringing the right solutions to bear to solve the problems, looking after for the client, as well as a technology partner that has the breadth of everything you see on this floor that we can pick and choose different technologies to bring together to solve their exact needs. So having a partner like Dell is very important because ultimately allows us to pick the right solutions for the customer and to bring to bear the exact solutions that are going to solve their issues and do so in a way where they're going to be 100% optimized, where the solution that they're running is going to be near 100% optimization as much as we can and therefore that's going to value the business. Do you tend to these days to come into an organization on a more sort of project basis or is it more things like, we're talking digital transformation or data architecture and then you figure out, okay, where's the priorities and the spending have to be? Is it kind of a top down or is it a bottom up or a middle out? It tends to be a little bit about, well, ultimately it ends up being both. So whether the conversation starts at a macro level and it's a more existential, how do we want to go to market and how do we want to support our business? A lot of conversations start that way. Sometimes it'll be bottom up where it is a specific project. We've got a net new application, we've got to go to market initiative and new geography, whatever it happens to be that is sort of what spawns that type of a dialogue. But ultimately those two things do end up balancing out because if you do anything well and the expectation is that we're going to do things well then it will grow or alternatively if the aspiration is that you want to do things in the best way possible, it'll attract and pull through use cases and projects as and where required anyway. So the two things end up becoming pretty symbiotic, irrespective of whether it started as a top-down, Michael meets a customer and sort of starts that way or it's something from the grassroots up that it's more demand-based from a project. When you have edge discussions with customers, how much of that is maybe it's the OT people or the folks out at the edge and how much is IT involved in those discussions? Tends to be, so it's becoming more mainstream that it's a more holistic conversation. So a little bit is always the case. Some of the early conversations tend to be about use cases that are very business-centric so that you'll have conversations with somebody who imagine somebody doing payments or distributed payments in financial services, something like that. And it's all about mobile banking and proximity and things. So you tend to talk to people about, well, what are the potential use cases? How do you monetize some of those things? And then you end up in a technology conversation or some could be potentially somebody says, well, look, we've got the capital markets group want to do something or the consumer bank want to go do something that's edge-centric. How would we go about doing that from the IT organization? We're now getting to a much greater degree of maturity with a lot of customers where it is a collaborative where you've got the person who owns the business problem or the business opportunity plus the technology group and it's a collaborative around, well, what does the technology solution need to be able to offer up and deliver? And if we can do those things, how would we then go and leverage that technology in the most effective way to drive those types of business outcomes we're talking about? Seeing a similar patterns? Yeah, I'm seeing very similar patterns. Ultimately, this is about tactical technology that has a strategic purpose. And you've got to remember, we've had edge-in-one-way shape reform around for the last 30 years. We just haven't done it very well. And the thing is we're starting to move a lot of these processes and a lot of these data collections and a lot of these analytics and a lot of knowledge engines out to the edge of the networks. And by doing so, that creates a strategic opportunity for folks in the organization to figure out how that's going to work for them. And so it isn't necessarily a geeky conversation that we're having, it's strategically we're looking to expand the way in which we're doing compute and doing data storage. It has these opportunities within the industry we're in. We're going to build this technology to make it happen. And that goes to both sides. People who do the implementation, boards of directors and CEOs. But you can geek out if you have to. Yeah. But they've all got to be there and that collaboration seems like it's absolutely foundational to overall projects being successful. Guys, thank you so much for joining Dave and me on the program today, talking about Dell and Deloitte better together and all the opportunities that there are to unlock the value in multi-cloud. We appreciate your insights. Thanks for having us. Our pleasure. Thanks. For our guests and Dave Vellante, I'm Lisa Martin coming to you live from Las Vegas, day two of our coverage of Dell Technologies World. Stick around. We'll be right back with our next guest. Thanks.


We have just received the first official POV of Copperhead Strike opening this year at Carowinds. Let's take a look at it. On Copperhead Strike's animation upon its announcement, the ride looked like it had potential to have some really good hangtime and airtime moments, and it's overall not a very intense looking ride, but very exciting, pretty well paced for but sometimes with the animations, you know, it's not quite what it is when it actually is operating, whether that's for better or for worse. So let's take a look at this POV we got from Carowinds. We start off by rolling out of the station, got this Jojo roll here, very unique element. As a lot of you know, this is only the second Jojo roll ever, so that's pretty exciting. We hit the barn here, which is going to have quite a bit of theming it looks like, probably going to be sitting here for a while on the ride and there's different things going on. Then we hit the first launch, and we go into this really circular loop. Looks like it has some pretty good hangtime actually. This awesome ejector airtime moment. Over this corkscrew here, go through a couple twists, pretty low to the ground there. Another airtime moment, then we hit the airtime launch here. Looks very exciting. We hit this sort of double up into this top hat here, which is going to provide another awesome moment of hangtime it looks like. Another overbank turn, we hit the second vertical loop here. Then we go through a lot of twists and turns here, pretty much staying really low to the ground. Lots of overbank turns, things of that nature, get really low to the ground right there. Basically just going through twists and turns at the end here. Another small airtime moment to end things off and then hit the brake run. This POV looks great, I think. This is just a test run, so it's barely warmed up yet. I think a lot of people were skeptical when this ride was announced because it's not super intense or it doesn't have the most airtime or the most inversions. It's not the longest ride, but I think this is going to be great for carer ones. Overall, I think a lot of people are sort of coming around more on this ride, including myself. A lot of us thought when it was first announced, it looks like a pretty fun ride, even a great ride, but seeing the actual testing footage now, it just looks great. It just looks like it's going to be a really fun ride. Nothing too intense. It's going to have more of that family appeal that carer ones I think is definitely going for. It's going to be good in that regard, but it's also going to be super thrilling for coaster enthusiasts as well. It's going to have some great airtime moment, some really good hang time. It looks like those loops might be fairly forceful as well, so I think this is going to be a great ride. I'm supposed to be getting on this actually in early June when I visit carer ones and Kings Dominion on my trip, so I'm really looking forward to this ride. One of my most anticipated for sure, especially now that we have this footage and looking at what it's actually going to run like. I'm really excited for this ride. I think it looks phenomenal. It's not, you know, like I said, it's not a Maverick level ride or a Helix level ride or anything of that nature. It's just a really fun ride. I think it's going to deliver some top notch thrills for carer ones. What do you guys think about this footage we have now? Is this what you guys were expecting? This is definitely looking a lot better than I thought it would for sure. I mean, I already thought it looked like a great ride, but let me know what you guys think in the comments below. Thanks for watching this video, everybody, and stay tuned for more roller coaster and amusement park content. Thanks for watching. This is Coaster Daddy. Bye.


Hello and welcome back. In this lecture we are going to see the use of pointers in function calls in C++ programs. Here is a quick recap of some of the relevant topics we have already studied. We have looked at basic programming constructs in C++. We have seen the pointer data type and the address of operator and the content of operator in C++. However, we have basically used the address of and content of operators within the same function in all the examples we have seen so far. In this lecture, we are going to actually use these address of and content of operators across functions. So, we are going to see the usage of pointers across functions. We will see how pointers can be passed as parameters to functions, how this compares with call by reference and we will also see what happens when functions return pointers. We are going to talk about memory addresses and pointers a lot in this lecture. So, let us quickly recap what these terms mean. Main memory is basically a sequence of storage locations. Each location in main memory contains a value which is exactly 1 byte or 8 bits. This is also called the content of that location. Each location in main memory also has a unique address. A pointer is basically an address of a location that is allocated in main memory to store a value and pointer valued variables basically store such addresses of memory locations. We are going to talk about function calls. So, let us quickly recap what we know about function calls. We can pass parameters to functions in one of two ways call by value and call by reference. We know that activation records are pushed and popped from the call stack which is stored in the stack segment and these activation records and the call stack are basically the mechanism by which we can manage local variables passing of parameters and also flow of control when a function calls and when a function returns. We have also seen that all local variables of all functions in a program are allocated space in the activation record of the function. The activation record itself is pushed into the call stack and the call stack resides in the stack segment. So, all local variables of all functions will basically reside in the stack segment. So, now that we have briefly recapped pointers and functions. Let us ask, can we pass pointers as function parameters? Well, why not? C++ does not put any restriction on what type of values you are passing as pointers. So, we can indeed pass pointer values as function parameters, but then when we are passing values as function parameters, should it be call by value or should it be call by reference? For our purposes in this lecture, we mostly going to look at call by value. However, it is important to note that C++ does allow passing references to pointers as well. And in fact, when you pass a parameter by reference and when that parameter is a pointer value variable like n star or car star, the C++ compiler will treat it in pretty much the same way as it does when you pass a parameter by reference and that parameter is a variable of some other basic data type like n or car. So, let us look at an example program where we are going to pass pointers as function parameters. So, here is the main program. It has two integer variables. I ask for their values and read them in and then I call this function swap by pointer. Now, notice what am I passing as parameters to this function? The addresses of the variables m and n. So, I am basically passing pointers as parameters to the function swap by pointer. So, the declaration of the function swap by pointer, I have to say that its formal parameters are basically integer pointers. When I define this function, when I specify how it works, I also have to declare its two formal parameters as integer pointers. Now, let us see what happens when this statement is executed in this function. I am basically reading in the values of m and n. I am inside the main function. So, in the stack segment, I will have an activation record of the main function when the main function is called by the operating system, that this activation record of the main function is created. Now, this activation record will contain storage for all the local variables of main. So, it will have storage for m and n, m and n are integers. Each of these need 32 bits or four bytes. And here, I have shown these four bytes as four addressable memory locations in the stack segment. More specifically, the activation record of main. Of course, the activation record of main will contain a whole bunch of other bookkeeping information also. Let us not worry about those for the current discussion. So, if I provide 5 and 6 as the values of m and n, then 5 and 6 will basically get stored in the memory locations allocated for m and n in the activation record of main. Now, when I call this function, I have to create a new activation record. So, note that in that activation record, the values of the parameters that I am going to pass are actually addresses of integer variables. So, the parameters are actually addresses and I am going to do a call by value with these addresses. So, essentially, I am passing two addresses as parameters and I am going to do call by value when I call this function. So, these two addresses will get copied to the space allocated for the formal parameters of this function in the activation record that will get created for this function. So, here is the activation record of swap by pointer. Here is the space allocated in it for its two formal parameters and the addresses of the variables m and n in the activation record of main which is basically hex 740 and hex 780. Remember, when we talk about the address of a variable, we really mean the address of the first byte of the contiguous sequence of bytes allocated for that variable. So, address of m is hex 740, address of m is hex 780. So, these two values will now get copied. So, this is call by value. So, the values of the addresses which is hex 740 and hex 780 will get copied into the space allocated for the two formal parameters of swap by pointer. So, here I will have the values hex 740 and hex 780. What is this temp? You will soon see that swap by pointer also has a local integer variable called temp and this is basically space allocated for that in the activation record of swap by pointer. Once again, this activation record will have other bookkeeping information. We will not worry about that for the time being. Now, within the function swap by pointer, here is our local variable temp for which we have already allocated space and here is the first executable step statement. Temp is assigned star pointer x. Now, note that pointer x actually has a value which is the address of a variable in the activation record of main. So, when I ask it to evaluate star pointer x, I am basically asking it to get the value of a variable in the activation record of main. So, this is interesting because I am accessing contents of memory location in the activation record of main from swap by pointer. So, what is that value? It is hex 5. So, that will be copied into the memory space allocated for temp. So, that is what happens here. And then when I go to the next statement, what am I doing? I am saying that look at the value of pointer y which is hex 780. Go to the memory location with that address star pointer y is saying content of the memory location whose address is given by the value of pointer y. So, content of the memory location whose address is hex 780. Once again, this is actually in the activation record of main. So, I have to read that value from there which is I have to read hex 6 from there and I have to assign it to the memory location whose address is given by the value of pointer x. So, pointer x gives me the value hex 740. I have to treat this as an address. Go to the memory location whose address is hex 740 and update that with the value 6 that I just read. So, that is what happens here. So, I have basically updated m in the activation record of main with the value of n in the activation record of main, but all of the subdivision happened from within the called function swap by pointer. And how did I achieve this magic? By basically passing pointers to variables in the activation record of main as parameters to the function swap by pointer. And then by dereferencing those pointers, I get access to the variables in the activation record of main. What happens when I execute this statement? I am copying the value of temp which is 5 to the memory location whose address is given by the value of pointer y. So, the value of pointer y is hex 780. This is the memory location reserved for the variable n. So, basically n will get updated with the value 5. So, note that what actually has happened is the contents of m and n have gotten swapped in the activation record of main, but all of this has happened inside the function swap pointer. This has been affected by the function swap by pointer. So, now when I return from swap by pointer, what happens is the activation record of swap by pointer is gone. However, the values of m and n have already been swapped. So, now when I try to print the values of m and n, I will actually print the swapped values. So, the model of the story here is that by passing pointers as function parameters, the callee in this case the function swap by pointer actually got access to the local variables of the caller in this case main. So, this is really a way to share variables between caller and callee and we have seen that we can also pass parameters by reference to accomplish this. And it is very interesting that when we pass parameters by reference in a C++ program after compilation, it is actually converted to passing pointers as parameters. That is how the called function or the callee function actually gets access to variables in the caller function or calling function. It all happens through pointers, but their pointers act behind the scenes. We only say that we are passing a parameter by reference. Of course, when you pass parameter by reference, some more bookkeeping is done. And as we will shortly see basically passing parameters by reference is like a bit of a tidier way of passing parameters by pointers where the passing parameter by pointers actually happens behind the scenes. So, to illustrate this I have written a program here which also tries to swap the values of two variables. So, just like before we have two integer variables and we read in their values and then I call swap by pointer as before with the addresses of m and n and we have just seen that this is actually going to swap the values of m and n in the activation record of main. But after that I also have this function which is swap by ref mn and note that I am calling these two parameters by reference. So, in the declaration of swap by ref I have to say that these two parameters are called by reference in the definition of this function I have to say these two parameters are called by reference. So, when I call a function with pointer parameters I have actually got to figure out what the addresses what the values of those pointers are before I call the function and then the formal parameters must be a pointer type and within the function I have to use all of these stars to really do the dereferencing of these pointers. Whereas, when I pass parameters by reference I actually call them just using the normal variables and it is only in the declaration of the formal parameters that we say that these parameters are really parameters that are being passed by reference in the body of the function also I do not need to use any star or any other operator I can just use these variables x and y as if they were the local variables of this function. So, what you see is that we can think of swap by pointer as really the back end way by which the compiler implements swap by ref because in swap by ref this function needs to have access to the variables of main, but the only way to give access to the variables of main is to actually pass pointers to the variables of main. So, that we know exactly which memory locations we are talking about in the activation record of main. So, swap by pointer can be thought of as how the compiler implements swap by ref, but of course swap by ref is much cleaner to use we do not have all of those stars over here we can just treat the parameters as the local variables of this function. Now, can a function return a pointer most certainly, but when you return a pointer from a function you need to be careful that the pointer is actually pointing to a legitimate address in memory specifically if the pointer is pointing to a location in the activation record of the function that just returned that activation record is going to be freed when the function returns. And so, when you try to dereference that address you will not be able to see a valid memory address and it will cause your program to crash. So, let us illustrate this by the simple program. In this program I have an integer variable B and I have an integer pointer variable A. So, I read in the value of B and then I pass the address of B to this function myfunk and it returns an integer pointer which I store in A and then I try to dereference this integer pointer. Now, what does myfunk do? It has a local variable A it does some calculation on that local does some calculation and updates the value of that local variable and then it returns an address to this local variable. So, note that this is a local variable in the activation record of myfunk. So, basically this is an address of a local variable in the activation record of myfunk. So, when I return back to the main function the activation record of myfunk is gone it does not exist. So, the address that is returned back here by myfunk which was the address of the local variable A in myfunk is actually a bad address when I try to dereference it my program will crash. On the other hand here is an alternative program where I actually calculate the value of A and assign that value of A to the memory location whose address is given by the value of pointer B and what was pointed B? Point of B was actually the address of a location of address of a variable in the main function. So, when I return pointed B I am actually returning the address of a variable in the main function. So, although A is a local variable in my function, but the address of the variable I am returning is actually in the activation record of main. So, therefore, I get a legitimate dereferencing. So, in summary in this lecture what we saw is that pointers or addresses can be passed as parameters to functions and this pretty much achieves what we achieved using call by reference parameter passing and this is in fact what happens behind the scenes when you do call by reference. But we also saw that there are some caveats to be aware of when we are returning pointers from functions. Thank you.