Hi, everyone. Welcome to our demo session about the latency and why it's the most important metric of your cloud. How many of you know who Storple is? Storple, OK, very few, right? So first, my role in the company, I'm the chief of product, one of the founders. Cloud Architect, meaning I help a lot of our customers who are cloud service providers, build and design and kind of deploy cloud services. And my background used to be I used to do kind of packet processing and kind of millions of packets per second on standard servers. And even before that, I used to kind of compete, do competitive programming, which is very interesting stuff if any of you know that. What we do is a very kind of fast and efficient software defined storage system. We deliver it as software and services on customers' servers in customers' data center. We started a long time ago in my youth and it's a clean slate design. So it's not based on anything. It's our own design from scratch. And that makes it quite more capable and it has a lot of kind of different capabilities to the storage systems you may be used to. Most of our deployments are with KVM. So even though we do have some deployments with VMware and Zen and Hyper-V, KVM is the most popular hypervisor among our customers. And we do have deep integrations into OpenStack and CloudStack and Openabula and OnUp and also in Kubernetes. So we play a lot in this kind of Linux KVM stack, right? So back to our kind of topic for today. Every transaction processing system without a load balancer, a web server, an application server, a database, a storage system, all of them have a performance characteristic that goes something like this. So you have operations per second and average latency per operation. If you increase the operations per second, you also get slightly higher latency. So for example, one task on four cars takes one second, two tasks one second, four tasks still one second. So this is still kind of one second per task completed, right? Where this model breaks is when you get six tasks on four cars or more, and then it's not six tasks in kind of one second per task, it's six tasks at 1.5 seconds per task. So you didn't do more work. You just hit what we call a saturation point. And these systems tend to have two very different modes of operation. One we call the elastic mode, where you have more demand, you get more work done. And then in the congested mode, you get more demand, you don't get more work done. So in kind of your application, where you want to run your systems to get the best user experience, pages opening fast, et cetera, is in this part of the curve. So imagine you have all kinds of different systems, storage, databases, applications, all kinds of systems, message queues. You want to run them in that part of the curve. Well, you wouldn't run them like some of your systems. You would run higher in the curve because it's more cost efficient. But the problem with running them close to the knee, close to the saturation point, is that the moment you go over the saturation point, it's only pain. Only pain means operations piling up, stuff piling up in queues. And you don't get just slightly higher latency. You get infinite latency, so really long queues that the system is trying to push through slowly. So this characteristic of the system, how high the saturation point is, you can call that the throughput of the system in some metric. So most of system vendors, storage vendors, database vendors, they like to brag about how many operations per second their system can do. Most cloud operators, when they sell you virtual disk, they tell you this virtual disk has this many IOPS. But in reality, for the performance of your application, this doesn't matter at all. What matters is how that system behaves in the part of this curve where you're going to use it. So it doesn't matter how high the line is. It only matters how low the latency is for the number of operations per second that you're going to put on that system. Well, with one exception, so the only reason you care about system throughput is that you don't want to get into the situation of going over the system throughput and kind of exceeding the system throughput. So a system that has a million IOPS helps you avoid going over the knee. So the demo I've prepared is that I have two different storage systems, two different virtual disks. Both of them have 20,000 IOPS, meaning if I take a few and measure how many IOPS per second both of these volumes have, they will both return to say it's 20,000 IOPS per second. So both of them could be sold by, say, in one cloud or another cloud, and they will have the same specification of 20,000 IOPS per second. And I'll show that application performance will be very different on the two volumes, even though they're both 20,000 IOPS per second volumes. So what we have is one virtual machine with 8 vCPUs and 16 gigs of RAM, a virtual disk with 20,000 IOPS per second, and a PostgreSQL database, which is four times the memory.  And in large web applications, these databases would be significantly larger than that. So it's not kind of a very extreme case. Can you guys see this, or should I make it bigger? Who doesn't see it? You don't see it. OK, I'll try and make it slightly bigger than. Just one second. There we go. All right, so how do we show it's 20,000 IOPS per second? We're going to run this test on it. And this is not the latency test, sorry. This is a random reads and writes, 50% reads, 50% writes, with block size 4K and a large Q-depth, so a lot of parallel operations, on a file which is on that virtual disk. And it didn't even get 20,000 IOPS per second second time. So this is the demo effect. So we can show that volume does 20,000 IOPS per second. So 10,000 reads and 10,000 writes, total 20,000. And PGBench is a benchmarking tool provided by PostgreSQL. The way we use it here is completely following the described test methodology by Postgre. It's not a complete, random benchmark that we wrote. It's an established benchmark. So what we do here is there are 16 clients in parallel on 8 threads. Why 8 threads? Because it has 8 vCPUs. We'll see progress every second. And total benchmark time is 10 seconds. And what we can see here is that with this many clients in parallel, this database can do there is the average transactions per second for the whole test. So I'll try to bring that higher. Let's do that a bit higher. 1,400 transactions per second on this volume. So what this gives us, so the storage volume underneath has 20,000 IOPS. The database we put on top does 1,400 transactions per second. So if we ask that database to do, say, 1,500 transactions per second, what would happen is, so in this common heal lag, this will, well, it didn't increase high enough. So let's try something slightly higher. So you have a queue of operations piling up. And now database transactions are not taking a few milliseconds. They're taking four seconds and five seconds. And a few minutes later, they will be taking a lot more. Because we are asking this database to do more than what it can do. Now, if we switch to another volume, so what this does is switches the storage underneath and restarts the database on the faster storage. That storage also, that's also a 20,000, try a second time, 20,000 IOPS storage. So 10,000 reads and 10,000 writes. And that database without the limit does about 3,000 transactions per second. So what we saw here is two virtual disks, both of them with 20,000 IOPS limit. OK. But the database with the same number of parallel clients, the database can do twice as many transactions per second. Which means that when you go to a public cloud operator and you buy a virtual disk with 10,000 IOPS provisioned on it, that doesn't tell you anything about the performance of the application you're going to get on top. And it's the state of the industry and why I'm doing this talk, that we need to talk. When analyzing performance, we need to talk about the elastic part of the curve. We don't need to talk. The IOPS is interesting, but it's not where we run our applications. And same thing. So if we do rate 1750, a database that can do 3,000 transactions per second, if we ask it to do 1,700 transactions per second, you'll obviously not get a pile up of operations. You get it's pretty happy processing days or something. All right, so moving on. So we are in the process of collecting interesting application benchmarks. So we think it's not well established that services which look identical on specification can be so different from each other. And what we did is it's still in progress, but we've started this process and we got virtual machines from a bunch of different public cloud operators and measured random reads and writes with QDepth 1 on the different operators. In digital ocean, we got about two milliseconds in Dreamhost, the dream compute service. We got about five-minute seconds average latency for 4 kilobyte storage operations, right? And so what do we learn from this? That digital ocean is very good at running SEF, right? The SEF cluster is three times faster than everybody else's. They've done a good job. The problem with this is that if you go to Amazon Web Services and you just buy EBS service from them, you get 0.3 milliseconds average latency, right? So it's not competitive. If I'm an application developer, I run my application on digital ocean and I will outgrow digital ocean at some point and I will move to AWS, right? It's just not competitive at all with the market leaders. And we also measure that in a production store pool cluster. This cluster specifically is running shared hosting services. It's about 80% full. Unfortunately, it's not a public cloud, but it's kind of a fairly well-loaded system. And we're going kind of trying to get a public cloud service in these so you guys can try out the same thing. So I wonder if there is a seven times difference in latency of the underlying storage system. So the way this test is designed, what it does is it tells us how far this end of the curve is from the beginning, right? So it doesn't describe the whole curve. It just tells us where the starting point is. So if you have seven times difference in that, what would be the difference in database performance or application performance? And the difference is kind of night and day. So on digital ocean block storage, which is self-based, you could get, like, if you have an application that needs, say, 500 transactions per second in a transactional database, you may run that on digital ocean and you will get 20 milliseconds latency for your transactions. But if you go to AWS, the same 500 transactions per second, you would get the same thing for 1.5 milliseconds average latency per transaction. And also, just in case you have an application that needs 2,000 transactions per second, you cannot run that on digital ocean. But you can run that on AWS or a faster storage service. So the difference between these is the digital ocean service is also limited at 10,000 IOs per second, the same as the EBS volume. The only difference between the two is latency of storage operations. They're both 10k, 10,000 IOs volumes, right? And I have a couple of minutes for questions. So does anyone kind of want to stand up and defend SAF? There are a lot of SAF fans here, I'm sure. No. Sorry. Any questions? Sorry, I don't hear you. What about SAF running over RDMA? I heard a lot, haven't tried, but. Right, so we don't. We are not experts in SAF, our company. And we don't run SAF clusters. And also, if we were running SAF clusters, it would be considered bad benchmarking because no one trusts us to do SAF well. So the best option is, if you have a SAF cluster and you run SAF with RDMA, we can run the same benchmarks on your cluster. I am completely extremely doubtful that that will make any difference, right? Because I don't think these five milliseconds of latency are kind of the latency to transfer four kilobytes over a network, right? It's kind of somewhere else in the stack. It's not there. RDMA allows to write directly to memory of another host. It does, but. Use performance. So sending four kilobytes over TCP connection, does that take five milliseconds? I don't think it does. It could send even one megabyte at one bucket within 10 milliseconds. So again, the difference between the systems is not both of these services. So the digital ocean service on this chart, the green one, and the Amazon EBS service, they're both limited to 10,000 IOS per second. So it's not about, in this case, it's not about how many IOS can. It's not about IOS, it's about latency. Right, so being able to send one megabyte over the network doesn't help this at all. It's just completely useless to help it. So as a package, like, you need to less amount of input output for operations at first, ability to write to memory gives you slightly lower what they let. It's very interesting and theoretical until I see it running. It's theoretical. Yeah, until I run the same benchmarks on a system like that, I don't believe it, right? I was curious if you have any. No, we don't. So last thing on set, we've heard these kind of performance has been a problem in set for a very long time. We've heard these promises that we're going to fix it in the next version, and Bluestore is going to make it better, and now RDMA is going to make it better, apparently. But it just never happens. It's just years and years and years, and it's not getting better. Bluestore was released. Yeah, Bluestore helped, but not enough. Thank you. Let's take that offline, because I'm being kicked off stage here, like my timer is down to zero. Thank you, guys.


Hello YouTube, this is Alex back with a follow-up to my video yesterday on picking tubular locks or ace locks. WadaC2 commented that he had never single pin picked one so I thought I'd show him my technique for what it's worth. The first thing I did was set up a my southward pick for this particular lock so that if I get it halfway open and can't get it any further I can undo it. So there it is operating with the key. This is a switch lock, an electronic switch lock, and then here it is just to validate that the pick functions. There it goes. You can see it turns around. Okay so this is an old pick that I made. It's a close-up of it for you. There, it's a pretty good shot.  It's cut to a little notch, kind of like a Pearson pry bar. All right back to you there. Good. And this guy sits right here. It just happened to fit very nicely and I'm just going to apply sort of enough tension to keep it from moving around and then I have one of my many broken old picks. So we apply a little tension and then we simply do our normal thing of try to locate pins that are binding. Springs are different strengths to prevent certain types of picking. Impressioning gets a little tricky sometimes to judge whether something is binding or just on a tough spring. There we are, finally. So I'm going to actually move this all the way. First I'm going to take this out very carefully so you can see that it's picked in fact. God help me, I hope this thing's still rolling it in frame. Yes indeed. So that is picked, single pin picked. Now what you'll see is if I turn it to here, you can hear it lock up again. That's because all the little pin chambers just pop back down on the top springs, but luckily I have my this tool to hopefully, there it is, clear it back to one of the positions where the key can run. So I would say not a terribly easy pick but not super hard. It seemed like it took me about four takes to get it in a reasonable amount of time. Again can be a little harder because the springs have varying tensions and there tend to be some sort of security features on the pins depending on the lock. But anyway, if you're bored and you want to open one of these things, it's a good fun and it is kind of cool because you can see the pins moving about as you set and overset and change tension, things like that. So it would be kind of a cool learning experience. Anyway, this is Alex, ace lock single pin picked for my good friend Wadis C2. Check out uklocksport.co.uk for other great picking information and lots of good people. Have fun and keep it legal. Thanks.


Yeah, time flies when you're having fun I guess. So we are at an end of our lecture course. So before I start, has everyone that needs to do an exam got an email from me about the timings and the modality of the exam? If not, do get in touch with either myself or Matteo or the course secretary. I've sent an email and set up a spreadsheet to sign up for particular times. So just let me know if there are any problems. What I haven't done yet so the exam will be on the 19th of April, so just over a month after the end of the lectures. And what I haven't done so far, but I will try to do as soon as possible is to write a few exercises for you guys. And but in the meantime, you can look at the references and they, particularly the book by David Mackay, contains many exercises and solutions to the exercises. So it's a very good book to work from. Anyway, the exam will only be, you know, five minutes oral because I guess you're doing one of these for each of the mini courses. So put them together, they will make like a proper exam. And I would just ask one or two short questions, nothing to be concerned to concern about. So excuse me, Professor. Yes, Carlo. Regarding the short questions, if I may ask, if I'm not pushing my luck, are luck too much? Will it be mostly a derivation of theory seen in the course or will it be exercises? Yeah, no, it would be mostly on the theory. Okay.  So all things that we've seen in the course and all pretty much theoretical material. I mean, many of these, many exercises in machine learning and in basic inference, it's quite hard to give easy exercises that can be done with pen and paper, you know, so the alternative would have been to do some sort of assignment, but you know, I think that might have been a bit too much. Anyway, back to where we were yesterday, brief recap. So are there any questions about yesterday's material? If so, do ask. But the bottom line is that we saw recap yesterday, we saw once again, the major flow of the major flow of basis function regression, which is the zero variance, we introduced as an abstract concept a class of stochastic processes, which we call Gaussian processes, which are stochastic processes. And a stochastic process is a collection of random variables indexed by a certain index set. I guess most people are familiar with thinking of stochastic processes as temporal processes, but they don't have to be just a collection of random variables indexed by a suitable index set. And in this case, it tends to be R to the end of the index set. But they have the property that every finite dimensional marginal is Gaussian. And it's not just any Gaussian, but it's a Gaussian, which is defined by the evaluation of a mean, with parameters defined by the evaluation of a mean function over the set of points that define the finite dimensional marginal, and the evaluation of a covariance function over the set of pairs of points in this set of, in this finite set of points, which define the finite dimensional marginal. And we've seen that the really the crucial ingredient, I mean, the mean function, you know, it's just a deterministic mean. So you could subtract it from your process and you would get zero mean process. But the key ingredient is this covariance function. Reference for this and also for today's material is the book by Erasmussen and Williams, chapter two, which contains everything that I would tell you and more. So we define these things, but how do we do computations with Gaussian processes? And in particular, how do we do predictions, at least in the regression session setting? It's the same old trick of doing computations with Gaussian. So we know now we are interested in a regression setup. So the scenario will be that we have pairs of input output points, yi and xi, where yi is a scalar and xi is potentially a vector, i equals 1 to n. And we postulate our regression model that yi is a function of xi plus a noise term. And this model we've seen many, many times. But this time, excuse me. Yes, Matthew. Gaussian processes are supervised learning, right? Absolutely. And that's why we have input and output and input pairs. Okay. Yeah. So whenever you have, I mean, the difference between supervised and unsupervised learning is when your data is defined in terms of pairs, inputs and outputs, that's supervised. If there isn't such a difference, it's unsupervised, basically. Having said that, you know, Gaussian processes for regression, so it's not a Gaussian processes, it's always supervised learning. Just Gaussian processes are a probability distribution of functions. If we are using them in a regression setting as here, then we are using them for doing supervised learning. But there could be, and in fact, there are some situations where you use Gaussian processes in an unsupervised context. For example, the Gaussian process latent variable model is a prominent example, which I will not discuss though. So we now have that the function f is a draw from a Gaussian process. And as I've explained, you don't need to worry too much about the mean function. So I'll put a zero mean function but with a certain covariance function k and epsilon i are iad. So what is the point of doing a regression? Well, the point of doing a regression is generally to predict the value of your output at a new test input. So this would be our training set of inputs and outputs. And then we assume you have a test input x star. And the question is predict y star. And that's your task in a regression setup. And it could be that you have a batch of test inputs. Well, it doesn't really make much of a difference. You will see naturally how to do it for a batch as well. So how would we do that? Well, the characteristic of Gaussian processes is that they have Gaussian finite dimensional modules. So we're going to define a vector f, which is made up of the function values on the training data, the function value on the tested data. Yeah, for these ones, we have corresponding observations. And for these ones, we want to predict the observation. Now, what is going to be the joint distribution of these n plus one random variables? They're very easy. These are all going to be distributed according to a Gaussian, that would mean zero, and covariance k, where k is a matrix, which we will write as this, k, k star vector. So this is a column vector. This is a transpose. And then this would be k star star, where entry of k ij is the function k on xi xj. So the covariance function evaluated the pairs of training inputs, while k star i, so the ith entry of this vector is the covariance function evaluated on xi and x star. So on all the training points, this is an n by n matrix. This is a vector in r to the n. We have n indices. And the ith k star star is the final piece of the puzzle, which is the covariance matrix evaluated at x star both times. This is the joint prior distribution over the function values and the training points and the function values at the test point. This is the thing we're interested in predicting, having observed all of these data. So how are we going to do it? Well, you see, if we condition on the function values on the training points, then we get a distribution for f of x star, which is the thing that we're interested in. So for each value of the function vector evaluated, function value evaluated on the training points, we get a different distribution of the output on the test point. Another question would be, okay, what specific value of f of x1, f of xn should I plug in? Well, one might simply think, okay, let's plug in the actual observations, but that wouldn't be too bad a choice to be honest. It would be a sensible thing to do. But of course, that would completely ignore the fact that the observations are noise. What we need to do instead, if you follow the philosophy of this course, is to do Bayesian model averaging. So in the end, what we're interested in is a prediction. So we want to compute the distribution of f of x star, given the data yi xi. Okay, how are we going to do that? Well, at the moment we have a joint distribution f of x star and then f of x1, f of xn. This is a joint distribution, but we can rewrite it as a conditional distribution times, you see, this is not, I've not finished writing yet. So we have, we want f of x star conditioned on the data. So the training inputs and output pairs, what we can rewrite it as is the f of x star conditioned on the functions on the training points and we don't observe the functions, we observe y, which is a noise corrupted version of the function. And then, however, we can use the data to learn something about the unobserved f of x1, f of xn. So we can construct a posterior. And of course, here, there is no trace of these variables here. So what we have to do is to integrate them out. So this is Bayesian model averaging in practice. Yeah. If we want a prediction of the output of the new test input condition on what we have seen, and we've not seen the functional values, we've not seen the f's at Xi, we've seen the y's, which are the f's plus noise. And what we need to do is to compute a posterior over those f's and then use that posterior to average out the latent variables f's. And in this way, we obtain distribution over the output given the data. What we need to do is, again, the usual Bayesian calculations. So we need to compute this posterior. Yeah. This posterior is obtained as a product of a likelihood and a prior, suitably normalized. So this is going to be proportional to the probability of the observations given f of Xi times the probability of, and this would be a product of Xi, because my observations have got iid noise times the probability of x1 x1. Okay. This is still the same calculation that we've done a few times now, but every time in slightly different contexts. So what we have, we have iid observations, which means that the likelihood factorizes. So the probability of y1 conditional x1 is independent of the probability of y2 conditional x2 and so on. And that's why we get this product here. And then we have a prior instead, which is correlated. So the prior over the function values is correlated and is given by the Gaussian process prior. Yeah. So these terms are all of the form exponential of minus a half, one over two sigma squared, yi minus f of Xi squared. Yeah. And this term here, instead, is exponential, is exponential, is one over square root of two pi determinant of the K matrix, exponential minus a half of f vector transpose K to the minus one. Okay. This follows from the fact that we have a zero mean of the process with covariance function K. And now this matrix K has as entry ij is K evaluated at xi. So we are given this prior. We have to compute this posterior and the way we do it is exactly as we've done for all the regression problems that we've seen so far. We have a likelihood term, which is factorized and actually all the regression problems that we will see in this course, likelihood term, which is factorized in a product of terms, each of them involving a scalar. And then we have a prior, which unlike the case of linear regression, where the prior was an identity covariance Gaussian on the weights, here is a correlated prior. Okay. So once again, we need to compute the, we need to compute the statistics of this posterior distribution and it's going to be, once again, it's going to be a Gaussian and it will have its own covariance matrix, covariance and mean function. So P of F. Sorry guys, it seemed to be having some issue. Can you still hear me? Yes. Yes. Okay. What can you see? I can see a black screen in front of me. So we have a white screen with some green rectangles. Probably you should stop sharing and then start. Yes, yes. So what were we talking about? So we had shown that the way you do prediction with Gaussian processes is through Bayesian model averaging, which means you need first to compute a posterior distribution over your function values at the training points because you don't observe the function values. You have to say the function values plus noise. And so this function values vector, we call it F, conditioned on the observations, which are pairs of inputs and outputs. And this is a product of a Gaussian likelihood times a multivariate Gaussian prior. So it is a Gaussian itself. And what are its, this is the calculation that we were doing. What are its statistics, its mean vector and its covariance matrix? Well, we have to equate the quadratic term in F in this definition. So we have to do something that will be, so it will be F transpose C minus 1 F. And the quadratic terms in the product of likelihood times prior. And these would have been, because we had n independent terms, we would have had n over sigma squared times, no, sorry, not n, 1 over sigma squared times F sum over i F of xi squared plus, this is the contribution from the prior. Okay. And now this thing here is equal to F to 1 over sigma squared F transpose times the identity matrix times F. So this tells us that implies that C to the minus 1 is equal to 1 over sigma squared, the identity matrix plus K to the minus 1. And if I take, I can take the minus 1 off from this side and add it on the other side. And then I can use the Woodbury formula. So there are a few identities that are particularly useful in this type of analysis. And one of them is the Woodbury formula, which gives you, so this should be equal to K plus sigma squared pi. Okay. She's basically telling me that the posteriori, the variance is added. Then the, what about the mean? Now to compute the posterior mean, I have to equate the linear terms in the equation that I had in the standard Gaussian formulation. The linear terms are F transpose C minus 1n. And in the product of likelihood and prior, now I don't have any linear terms in the prior because it's a zero mean prior, but I have linear terms in the likelihood. And those linear terms are on the form of sum over i, f of xi times yi divided by sigma squared. And these I can view it as F transpose as 1 over sigma squared, F transpose vector times the vector of the observations. And I see there are some issues in the chat and I'll finish the calculation and I will get back to you on that. And so I get the posterior mean is equal to the matrix C times 1 over sigma squared and the vector of the observations. And then using what I derived before, I get C was this object here, I get k plus sigma squared 1 over sigma squared. Okay, so we had some questions in the chat. What is it, is the Woodbury formula also known as Sherman Morrison? Well, Woodbury identity or Sherman Morrison formula or it goes under several. So I'll kind of give you the link Wikipedia page. So in this case, it's a particularly simple situation where you have a is equal to C to k and C is equal to 1 over sigma squared times the identity and U and V are identity matrices. Okay, so let's get back. So what we need to do now, we need to compute the we need to compute the predictive distribution and the predictive distribution P of Y, not Y, F condition on the data is obtained as an integral over the F variables when F is a function values, unobserved function values at the training inputs of the conditional F of X star given F training inputs times the posterior over the training inputs given. Now this is a somewhat unpleasant calculation because it needs, you need to compute these conditional M and computing conditionals as I think, you know, we discussed in one of your lessons. When you have your system defined from equations, it's trivial to compute conditionals. So, you know, if I have my equation Y equals F of X plus Epsilon, then it's trivial to compute probability of Y conditional F. But when you have your system defined in matrix format, then you need to, and what you need to do, you need to take the joint of these things which has a joint covariance, which we have written compute the so-called and computed the conditional, which means fixing the F and computing what is the resulting Gaussian. So I'm not going to do this calculation, but I'll write out the result, which you can find and you can find the derivation in the book of Rasmussen and Williams and it's on page 16. And then we will comment the results together. So this is again a Gaussian. It's a one-dimensional Gaussian, so it's got the variance and it's not a covariance, it's a new variance. Now the mean, so expectation under the posterior, under the predictive of F of X star is obtained as, is obtained as a linear combination of the input data and is given by a very nice formula, well, relatively nice formula.  So this is the vector, if you remember, it was in the previous failed zoom meeting, k star is the covariance function evaluated at x i, so index i, x i. So you take the covariance function evaluated at all the input points that gives you, and at the test point, all the training points and the test point that gives you a vector, you multiply it times these matrix, which is the posterior, the inverse of the posterior covariance, and then you multiply, so this is n by one, so transpose is one by n, this is n by n, this is n by one. So this is the mean value. It's interesting to observe two things, so it's a linear combination of the inputs. So the posterior mean, the predictive mean is always a linear of the training outputs, not inputs, sorry, but also it's a linear combination of terms of the form k x star x i. And so if you think of it as, each of these ones is like a basis function, it's a function x i is fixed, so I mean this contains the x i and the x j, so this is just a matrix of fixed numbers. x star is the thing that is a variable, we're trying to predict the function of f at x star, which is our independent variable. So it's as if we are doing a linear combination of basis functions, but the number of basis functions that we're using is the same as the number of training points. And that is completely different from the setup of basis function regression, where you fix the number of basis functions and then you do your regression. Well here, so here the number of basis functions, if you wish to call them like that, is equal to the number of data points. So sometimes people call this some sort of adaptive complexity of the model. So the more data points you have, the richer the class of functions that you can use for your predictions. So the more training points you have, the more basis functions you're going to use, the more complicated your predictive function is going to be. Okay, is this clear?  But the line of reasoning should be clear. You know, we have this process where the finite dimensional marginals are multivariate gaussians with correlations. So given some training data, we can compute the posterior on the function, so some noisy observations of the function. We compute the posterior of the function. And then the correlations induced by the Gaussian process through the covariance function enable us to obtain predictive distribution over the function value at the new input, which is going to be Gaussian and has a very specific form. Here we're exploring the form. We obtain it through model averaging Gaussian, Bayesian model averaging. And the form is quite interesting because as you see, the predictive function is a linear combination of the outputs that you observe your training outputs, but it's also a linear combination of a number of basis functions and the number of basis function, which determines the complexity of the functions that you can observe, increases the more training data points you have. Some people even call this kind of automatic outcome razor because it kind of controls the complexity based on the amount of data that you have. Is this clear? Do you want to ask questions on the posterior mean? So if there are no questions, let's move on to the posterior covariance now. So obviously the predictive distribution is a Gaussian, so it's got its own mean and its own variance, and we are looking at predicting at a single point, so it's one-dimensional random variable. So we now want the variance, so we call it C star, which is the same thing as the variance of f of x star. And how do we obtain it? We do Bayesian model averaging, so we do a whole lot of Gaussian computations, and that's a bit tedious, but it's in the book if you want to look at it. Now, the final result is this. So remember what these terms are, so remember that I had defined, I had broken out my, so this is, let's say this is big sigma, let's say where p of x star is no more big sigma. So the joint distribution of f of x star has got this block structure, the joint prior distribution, which contains k, which is the covariance matrix evaluated at pairs of input points, or a pairs of training input points, then k star is the vector obtained by evaluating the covariance function on the training input and the test input, and then k star star is k or x is the prior variance, so let's play on x star and x. So two important, well a number of important observations here, so there's no way here, there is the data, the observed output, so the posterior variance does not depend in any way on the observed values. Now, this might seem a little bit strange, because you know, suppose I had observed function values like this, but if here, then you probably would be reasonably confident that it's somewhere here, the function, and I would have some function, but if instead I had observed, and I'm one point here, massive outlier for whatever reason, and I try to predict in the same point, well instead of saying well it could be anywhere between here and here, no it would give me exactly the same posterior variance. Yeah, exactly the same predictive variance, I would say it's probably around here, but it would have exactly the same predictive variance as here. So this is a little bit weird, and the other thing that is kind of weird, so this term is the prior variance. If I take the Gaussian process and take its one-dimensional marginal, which is the value of the function f at x star, okay, one-dimensional variance, what would it be? Well it would be the covariance function evaluated at that point and at that point, so two inputs which are the same, so that's the prior variance. So observations will always, the predictive variance, the posterior or predictive variance, I'd say posterior or predictive, the posterior predictive variance is always smaller, so observing more data always makes you more confident of the value of the function, so which once again kind of makes sense in the let's say business as usual scenario, but in a scenario like this where you have an outlier, it doesn't really make sense, if I had observed all of these points, let's say, then I'd be relatively confident that I have a function like this, and at this position here, I would predict somewhere here with a certain variance. Now if just before here, I observe another point all the way up here, then my Gaussian process would have to work extremely hard to try to fit that. The posterior mean here would be shifted up, but it's actual uncertainty, would that be shrunk, which is really strange, it really shouldn't happen that way. So you know, there are some very nice things about Gaussian processes, and so just to wrap up this kind of very rapid introduction, and it's not surprised that they are amongst the most widely used techniques in machine learning. So this is the GP pros and cons.  The other thing that is important to notice on this posterior variance, predictive variance, is what happens if I'm trying to predict at a very far point. So as you will see, this term, if you have a stationary Gaussian process, will not, you know, it will be the same. The prior would be the same everywhere, whether you're trying to predict near the data, or whether you're predicting very far from the data. But this reduction term depends on this k star basis functions. And these k star basis functions are of the form k of xi, where i is a training input x star. So if xi, if the training data is very far from the point where I'm trying to predict, say I'm trying to predict right here and all my training data is here, then these terms will be very close to zero. And obviously this does not depend on where I'm testing. So the third thing is that far from the data, from the training data, the variance is constant and greater than zero. So it returns to the prior variance, which is a good thing. So these two things are a bit bad. But this is a very good thing. We have a model that when it's far from the data, it will return the honest answer of saying, well, you know, these data is so far that it doesn't really tell you much about this function. I tell you what the prior is, which is great. It's also what basis function regression was saying, except that basis function regression was set up to be infinitely confident far from the training data. So GP pros and cons, they're flexible and they have this adaptive complexity, which is a great feature. The more data you have, the more complicated functions you're allowed to express. The other big pro is that they're somewhat, you know, honest with the data. So far from training, they return. So these are pros. The big con is what I've described before, which is they are somewhat vulnerable to outliers because the posterior variance always increase. And the final problem, which is something that has exercised machine learning researchers for a lot of time is that as you see here, you need to invert an N by N matrix in order to obtain the posterior variance, or you need to solve a linear system. We don't necessarily need to invert the matrix. We need to solve an N by N linear system to get the posterior mean. And so a major drawback is that the scale has a big O of N cubed where N is the number of training points. And therefore, you can't really do very large data sets. But however, there exists some partial solutions. Okay, so I hope that this has given you some idea of some of the potentially interesting things that can be done with Bayesian inference. We've actually really looked at the linear case, the linear Gaussian case, which is the only set up where you can do calculations explicitly. So you can write out analytically, you know, I could write out that I need to, you know, if I specify what K is, for example, the radial basis function covariance function, then I can write analytically what's the function, the predictive mean and variance everywhere in the input space. I can do the calculations, which is great. On the other hand, of course, they are only a very small subset of what machine learning is about, particularly these days. But they're still quite a useful subset because they're tractable and they give you a good insight about how the methods work. And I hope this will be of use to you in the rest of your career. I appreciate this maybe slightly tangential to some other complex systems things that you'll be seeing, but you know, being able to model some data will presumably come handy at some stage in your lives. So thank you very much for staying with me for all this time. And thank you, Matteo, for inviting me. And I guess I'll see at least some of you at the exam. Yes, so the final questions are okay, so I think we can stop here. Thank you very much, Guido, for this very good, very interesting course. And so see you all tomorrow. Yeah, and do get in touch with me if you have questions or anything. So, you know, my email is easily obtainable. Thank you.


From DailyDoseOfWeirdNews.com, I'm Darren Marlar and this is your Daily Dose of Weird News. This episode is brought to you by the audiobook The Last Observer – A Magic Battle for Reality by G. Michael Vasey, narrated by Darren Marlar. Here are a free sample on the audiobooks page at MarlarHouse.com. The Lord of the Elements wants to change reality. He has enlisted the evil Zeltan to help him and together they will try to recruit Stanley, a man gifted with incredible, imaginative capabilities to help them. Unless Edward and his friends can stop them, that is, a tale of white and black magic, quantum physics and a plot that twists and turns. If you like science fiction, fantasy and horror, you'll love The Last Observer – A Magic Battle for Reality by G. Michael Vasey. Here are a free sample or purchase the title by clicking the link in the show's description. Treasury Secretary Steve Nugent has created doubt that Harriet Tubman will replace Andrew Jackson on the $20 bill. A man died Sunday at the famous desert celebration Burning Man after running into the giant wooden structure set on fire. So he actually became the Burning Man. You can now spend a night in the house where a Christmas story was filmed – $495 a night in the off-season, meaning it will not be a Christmas story for you. As of last Friday, Americans are now officially banned from traveling to North Korea. It's the only travel ban aimed at a single person. Whose name happens to be Dennis Rodman? In Italy, a 63-year-old man was having a mausoleum built at the cemetery in his hometown. He wanted his eternal resting place to be just right, so he made frequent visits to make sure that the construction crew was building it exactly to his specifications. On his last visit, he climbed up a ladder to get a closer look at the top of the mausoleum. That's when he slipped, hit his head on a marble step, and fell dead into his tomb. Well, I guess that saves money on renting the hearse. A Seattle therapy group for kids is putting the hammer down on the usual questions like how do you feel and why aren't you doing your homework. The group, Wheelhouse Workshop, instead uses Dungeons & Dragons to get kids and teens to open up by playing characters in the game. Parents of the children say it works extremely well, right up to the point where you tell them it's time for a bath and they try to do a saving throw. Lavar Ball and his family are set to star in a reality show called Ball in the Family. Begging the question, who the heck is Lavar Ball and how did he get his own reality show? Thinking about getting a pet, did you know that the most expensive household pet to keep is not a dog or a cat, but actually a tortoise? The animals can live for more than 75 years and during that time they would set you back about $36,000. Plus, there's the increased stress of trying to get him to pick up the pace when you take him out on his leash. The execution of a death row in Mated, Texas was delayed because of Hurricane Harvey and has been moved from last week to December 14th. Proof that hurricanes are evil. They kill others while saving the life of those scheduled for execution. A new study indicates 15% of office email is Gossip. The average corporate email user sends 112 emails every day. Of those, about a 1 out of 7 is gossip according to a study by Research at Georgia Tech. When you say gossip, most people immediately have a negative interpretation, but it's actually a very important form of communication. Even tiny bits of information, like Eric said he'd be late for this meeting, add up. Okay, I don't think I'd count a message if Eric is going to be late as gossip, though. But I'm shocked that we send an average of 112 emails every day? Seriously? How does that leave time for Facebook, Twitter and YouTube? L'Oreal has fired their first transgender model after she posted on Facebook that all white people are racists. It's amazing how those who scream that they should be accepted are quick to label and condemn everyone else. Can you create a burglar broke into a church to steal gold fixtures? That's when the plan fell apart. It seems he fell asleep and got locked in the weekend's only facility for five days, surviving on the only liquid available, sacramental wine. Five full days in a church to contemplate your life before God and think about the wrongs you've been doing. Sounds like a fitting punishment to me. Angelina Jolie showed up at the premiere of her new movie, First They Killed My Father, which she directed, produced and co-wrote, in Colorado with all six of her kids. Everyone was well-behaved in the beginning, until her kids had to tell Angelina to stop kicking the seat in front of her. If you're already an official weirdo, please share this video on Facebook, Twitter, Reddit and other social media to help get the word out. To become an official weirdo, click that subscribe button and click that little bell next to the subscribe button to be a part of the notification squad. While you're at it, click that like button to let the world know that you are an official weirdo.


but what they really were focused on is growing us as human beings into the best leaders we could be and they offered, you know, instructional classes that had a lot to do with emotional intelligence, not necessarily focusing on, you know, what you could get done, but how you got it done. And I bit hook, line, and sinker. I'm just a human nature guy. So I really enjoy being in scenarios where I could help people grow and be their best selves, which obviously is translated out here.


This paper provides an overview of the latest studies on using nanoparticles to enhance oil recovery through mechanisms such as disjoining pressure, viscosity increase, preventing asphaltine precipitation, wet ability alteration and interfacial tension reduction. It also reviews novel nanoassisted EOR methods targeting thermal, chemical and gas methods, identifies challenges and opportunities for future study regarding application of nanoparticles in EOR processes. This article was authored by Xiaofei Sun, Yin Yu Zhang, Guampeng Chen and others.


Would you rather have Baker Mayfield or Mason Rudolph as your quarterback?  Baker Mayfield, he's better than Mason even though I'm a die-hard suicide fan. Mason Rudolph for sure, Baker Mayfield's strong. Hey Rudolph, hey Rudolph, sexy. Baker Mayfield, he's a better quarterback, Mason Rudolph. Do you think Mason Rudolph's better than him? No, no change, no. So you'd rather lose games than win games. It was at this moment that he knew. Baker, Mason has quick legs. Baker **** Mayfield, because he's the best. Not **** Mason Rudolph. So you'd rather have Baker Mayfield as your quarterback? Hell yeah. Bing Bong, I'm gonna say Mason Rudolph. Baker Mayfield. Why? I'm starting a quarterback. Mason Rudolph. Why? Because he's an old ****. That's why you want to match your quarterback? Yes sir.


What's up everyone? Takedown here. Welcome back to another video. I am extremely excited today because we're going to be talking about how to game share on the PlayStation 5. Yes, game sharing is still a thing and it's super easy to do on the PlayStation 5. It's just a lot of people don't know about it right now. And that's why I want to share it with you guys today. Let's get right into this. So they have made game sharing so much easier compared to the PlayStation 4. I know PlayStation 4, how to game share. I ended up having to call Sony and they explained to me how to game share. Now that's not something that they typically announced to people, but they did on the phone. But with game sharing on the PlayStation 5, they made it so much easier and I can't wait to share it with you. Now the first thing that I want to mention is only game share with someone that you can trust a friend or a family member, something like that. Don't just go and give your information to somebody because they said they're going to give you a game. That's a really great way to get hacked and lose your account. Absolutely do not do that. And for anybody that's going to put their login information in the comment section, for the most part, I'm going to be trying to delete all of those comments like I did for the last video talking about the PlayStation 4 game sharing because I don't want to see anybody get hacked and it's because they commented their information in this video. Please don't do it. Only game share with a friend or somebody that you will trust. So now how I'm going to explain it is for you, how you can game share with a friends and vice versa. But I'm going to be explaining it that way because it's a little bit easier to understand. So the first thing you're going to want to do is log into your accounts on your PlayStation 5. This is you logging into your own accounts on your own PlayStation 5. On the main menu, click the gear icon right next to your avatar. Next select users and accounts, then select the other option. Now you're going to want to select console sharing and offline play and make sure that it says disabled. If it shows that it's enabled, just switch it to disabled. Now your part is done as the person who's game sharing with a friend. Now what you're going to want to do is give your login information to your friend so they can log into your accounts on their PlayStation 5. Now you're going to have them go through the same steps that you just did. So they're going to log into your accounts on their PS5. They're going to go in the main menu and they're going to click the gear icon right next to the avatar. They're going to select users and accounts, select other option, and then they're going to select console sharing and offline play. Instead of hitting disabled, they're going to select don't disable and make sure that it is enabled on their PlayStation 5. That is how you game share with them. Now, while they are still on your accounts, they can simply go into your library and download any of the games that they want to play on their own accounts. Now, just as a reminder, as of right now, it's only the games that are on your library that you can game share no more. But hopefully in the future, they will change this.  They can't just go and delete your account information after doing this because all of the games that they downloaded from you will then show a locked icon on it and they'll have no access to the game.  Now, you can if you game share just like the PlayStation 4, you both can play that game at the same exact time. You can play it against each other, play it together online and everything just like a normal game as if both people purchase the game themselves. Now, the one thing with game sharing with somebody is if you game share with somebody, now you cannot play your games offline, except if you have a game on disk. Any of the games you downloaded from PlayStation Store, if your internet goes out, you will not be able to play any of those games. And any of the games that you downloaded for free for PS Plus, you won't be able to play any of those games, just the games that you have a physical disk for. But there is an easy way that you can do this.  If you want to play or have your friend play any of the games that they got from you, then you'll have to go and disable it again. And on your accounts on their PS5, they'll have to re-enable it and then they'll have access to all of their games once again. So like I said, it is super, super easy to game share on the PlayStation 5. They really made it super easy this year. And I'm really glad they did because that means you can game share with your friends and two people can game share together instead of everybody having to purchase their own games. For example, if you and your friend see that there's two games that are interested to you guys, instead of you both purchasing two copies of each game, one person purchases one game, the other person purchases the other one, and then they game share the games, which is a really, really awesome thing. But once again, I just want to mention only game share with somebody you trust because you can easily get your account hacked if you're simply just giving away your login information or posting it online. Like I said, I'm going to be trying to delete all of those comments that people are doing that because just like the last video, people are still going to do that, even though I gave a warning about not doing it. Hope you guys enjoyed this video and hope you guys are enjoying game sharing on the PlayStation 5. Comment down below how that worked out for you and if it works. And I hope you guys are really enjoying your PlayStation 5. I'm going to leave this video here. Please take care. Peace.