Today's first speaker is Pierre Poloniat from Columbia University who will be discussing formal verification of blockchain Byzantine fault tolerance. Pierre. So actually it's Vincent who will be doing the presentation today. So yeah, Pierre used to be a student at University of Sydney. Before I joined Columbia and this is mostly his work that I'm going to be presenting, but unfortunately couldn't make it today. Okay, so is blockchain secure? You might know that some blockchain assumes synchrony, of course depending on the way you look at it, whether they don't ensure finality or they assume some synchrony in order to get this finality. So finality is necessary if you want to reach the classical notion of consensus that we find in distributed computing literature because we need a termination at some point.  And the problem is that if a hacker can delay messages while the system assumes synchrony, then it could potentially steal assets by for example double spending. So this is a key issue in blockchain systems as you can imagine. So just to cite a few attacks that appeared in the literature. You know there are several attacks that exploit this phenomenon of delaying messages right if for example you can delay messages in a blockchain like Ethereum, you could potentially reorder the transactions and this could lead to front running attacks for example. So there are other attacks that consist of trying to partition the network into two groups where the mining power is balanced right so that they have roughly the same amount of money power and this allow a hacker with a very small mining power to do a double spending attack and so on so forth you can imagine that you use bgp hijacking in order to create some delays in the network and this might affect Ethereum again. So there exists the attack of the clones that relies on the same idea where essentially you partition the group of validators in the proof of authority consensus in order to try to double spend right so it's not uncommon to see this kind of vulnerabilities that rely on this synchrony assumption and by synchrony here I mean maybe it's important to to clarify what I mean here is that there is a known bound on the time it takes to deliver any message in the network. All these attacks consist of trying to delay the messages such that the bound is exceeded. But there are some really interesting algorithms that were also motivated by the blockchain space and applications that tolerate a synchrony, which means that they do not assume synchrony. And for we can cite at least the honey badger of bft protocols and the beat protocol. Okay, so these do not assume synchrony which means that they are not vulnerable to this type of attacks. So this is interesting. However, they rely on the same randomized consensus algorithm. And these consensus algorithm was published at Potsky, which is one of the biggest, probably the biggest distributed computing conference and got the best paper work. But there is a liveness issue in this in this protocol that I will talk about in a minute. And this a synchronous randomized algorithms that I talked about rely on an underlying binary consensus that is randomized that is presented in this paper. Roughly speaking, and I won't go into too many detail here. I just want to online outline the execution of this algorithm it relies on on the wild true loop. Of course, at which point you can at some point you can exit the wild true loop applying 10 if you decide. But it is what you look consist of trying to refine an estimate that is called est that you can see online one for example, and it will do so by in each iteration of this one true loop by the broadcasting which is a broadcast primitive that is called binary value broadcasting. It does some very nice property. It's a random common coin right so a random common coin is a is a way to invoke so do random generator and output at any correct process the exact same value right so it can be invoked by multiple processes but it will return the same value at the same invocation. Right for all these correct processes. It's a very interesting algorithm. And, and it, and you can see on the right hand side the bv broadcast. But there is a problem in this algorithm. The problem is that it lacks termination, which means that there is a possible infinite execution where the consensus algorithm will never terminate. And a simple concert counter example that we present relies on four nodes where you have T equals one which means that you have one failure in the system. And the rest and in the rest of the talk I will refer to T as the maximum number of figures you can have in your system. These failures are Byzantines right there are arbitrary failures. And you have this n minus T processes that invoke the common coin and because of Byzantine for common coin implementation you need to return the common coin as to return when you have n minus T invocation. And then the Byzantine participants which is the faulty participants that can behave arbitrarily, which can represent the hacker if you want will exploit the outcome of the common coin in order to slow down selected messages. And if he does so, then he can make sure that the correct participants there are three of them right because we have four participants in this consensus will move from having estimates 001 to estimates 110 and so on so forth. So they will just loop in this from one round to another well they will change their estimate from 001 to 110 001 110 and so on so forth. Right, so there is a case where there is this infinite execution and this is enough to show that the termination cannot be insured. The nice thing is, and I want to highlight this. There exists provably correct alternatives to this protocol, right. And one that is remarkable is that the same author came up with an extended version of this paper this algorithm that they presented in Journal of the ACM in 2015, and this alternative protocol as the same asymptotic complexities as the original protocol but solves the issue. There is also a paper by cashier and Zalini is Zalini that was presented at this, this year, like yesterday I think, and that also has a provably correct alternatives. The only thing is that I'm not aware of any implementation of this algorithm. So what we decided to do is we decided to create a blockchain that we call the red belly blockchain. And the first thing we did is we focus on the consensus protocol. We wanted to tolerate periods of a synchrony. So for those who know it's more like a partially synchronous model. Because we didn't want to have the vulnerabilities I've mentioned in the beginning. The protocol works as follows so it's very similar to the randomized algorithm, except that we got rid of the random coin. Right. So what we used is the parity of the round to make sure that we would break symmetry and that the protocol would converge towards a single estimate that will be decided by all the correct processes. Okay, so we really wanted that we needed it in order to reach consensus. So that was key. So we have a blockchain on top of this algorithm that we call democratic BFT, and we people, we published it as IEEE security and privacy this year. The BFT is scalable, and it actually uses the same technique that was presented in dandelion, which is the idea of super block optimization. There are a lot of proposers that are proposing their block but instead of trying to accept the leader block, you just aggregate all the blocks that were proposed into a super block. Right, and that's how it scale as you can imagine it, you know, it commits a number of proposals that is linear in the number of notes that participate. I know that we published this year. But this is great, right, and there are a lot of blotching that, you know, reach very good performances on the paper, or, you know, on blog posts or you know online, but how to make sure that the consensus itself is correct. Right, it could be, could be wrong and that might be the reason why we have so good performances. But that leads to this work. So I'm going to go quickly through the related work just mentioning that there are a lot of very nice ideas that have been that came up since 1999, for example, that consists of exploiting machine assisted proof in order to prove in a safer way. I'm not saying that these techniques are completely safe, right, or completely secure as even a model checker needs to be proven correct, but they reduce considerably the risk of having mistakes in the proof of the consensus algorithm. Right, so it reduces the risk of having double spend. The way we achieve. We did the model checking of our consensus algorithm is as below we use a threshold automata representation of our algorithm. So just to have an example, this is a very simple binary value broadcast. You know, abstraction, which is simply broadcasting some estimate, if you receive, if you receive t plus one estimates, the same estimate from t plus one distinct processes or participants then you re broadcast so it is very similar to reliable broadcast for binary if you receive to T plus one identical values from sorry, yeah, identical values from to T plus one distinct processes, then you deliver right it means that the there is a BV delivery, if you want. And so what we can do is we can represent this algorithm at the bottom that is a good explaining sort of code as a threshold automaton with nodes and transitions, right. So you have local states that are locked V zero log V one that indicates that the process is as come as an input value zero log V zero or input value one log V one. And then depending on what happened in the system, you update shared variables that are for example B zero, which is a shared viable that counts the number of zeros that are being broadcast in this BV broadcast algorithm. If the guard is true, then the action might be taken. Okay, so you have these counters that are shared counters updated by all correct processes as they execute as they transition through this automata, or automaton in this case, and there's only one. What you can see is that this automaton is symmetrical. So I don't need to care that much about one side, and I will just focus on the side where you have the initial value zero. Okay, nothing has been broadcast when you were in lock be zero. The zero value has been broadcast and nothing has been a baby delivered when I reached lock be zero. I will reach lock be zero one which means that both values and zero and one have been broadcastness, but nothing has been delivered yet. And the earliest moment where we can transition is upon reception of ones from F faulty processes and after B one once were broadcast by correct processes, and this is modeled by B one plus F, which is the actual number of failures is greater than T the number of failures plus one log V log C zero indicates that zero has been broadcast and only zero has been be delivered, both zero and one have been broadcast and only zero has been be be delivered in log be zero. There is a self loop that will indicate the a synchrony. Both zero and one have been broadcast and both have been be delivered when we reach lock C zero. So you can see that it's quite simple to model algorithm distributed algorithm in threshold automaton. So you can express a beefy justification which is one of the property of these baby broadcast using linear temporal logic, right, as follows, I won't go into the detail because I'm running out of time. And what we did is we did the same thing for a consensus algorithm we obtained is very large threshold automaton on the right hand side that we decompose we split it into two to automata one for the baby broadcast and one for the rest. And what we could do is we could do the formal verification using parametrized model checking thanks to the bison team model checker that has been published at purple 2017. And for that we formally verify the agreement validity and termination which are the three properties of the consensus in less than 18 minutes. Right so on an MPI cluster of course we needed a bit of resources to do so. We believe that formal verification of consensus is important for watching adoption in secure applications. So I just wanted how to prove the safety of the DBFT consensus algorithm used in the red billy blockchain. For the liveness proof, I recommend you to look at the follow up work with my colleagues. And which you can scan here and for future work we would like to leverage this formally verify consensus algorithms mark contracts in order to obtain a more secure sharing economy. So I'm going to talk about the the MOOC where I talk about DBFT in more details and the red billy blockchain, if anyone is interested to know more. Thank you for your attention.


I would like now to welcome Josie Fraser, who, as I said, works for Leicester City Council, is the ICT strategic leader here. She's going to be talking to us today about the city as a learning environment, making change happen in Leicester schools. Without more ado, I'll pass over to Josie. Hi everybody. Thank you for coming to see the session. Thank you and hello to everybody watching live or following on Twitter as well. Thank you very much to ALT for inviting me to come and talk today. I'm going to talk about the school sector. I know a lot of you don't necessarily work in that sector, but it is the most fascinating educational technology sector, obviously, and there's some very interesting things going on there. My title today is Leicester, sorry, the city as the learning environment. I think my arms may not be as long as yours. Leicester, that's where Leicester is for those of you who don't know. When you come and visit, you'll be able to see how close you are. We've got around 290,000 residents. It is about one of the 10th largest cities in the UK, and we're one of the UK's most ethnically diverse regions too. We're very rightly proud of our culture and ethnic diversity in the city, and it's something that we celebrate and something that we see as a characterising feature of our city and as a real strength. At the moment, I'm working on the BSF programme in the city, Building Schools for the Future programme, which has been drawn back by the government, but Leicester remains in place, although we have gone through efficiency savings across the programme. It's around a £340 million programme, and we're building or refurbishing 28 schools sites, and those schools include SEM schools, the Hawthorms Hospital schools, the main students schools, and also the student support centres that are also known in some parts of the country as the pupil referral units. We've built four schools already, and we are going to build quite a few more, because it's 28 in the programme. We've got builders on site currently at the moment, building on site, and at the end of the month we're going to have another two sites up and running. The programme end is around towards 2015, so it's an extremely rapid programme, one of the most rapid building programmes in the country for the sector. My role, I'm ICT strategy lead, and I work within Children's Capital, and my role is to work in partnership with the other strategy team leads, their sports and fitness, arts and culture, learner voice importantly, and I'll be talking a little bit about some of the work that the learner voice team has been up to this year in a minute, sustainability and special education needs. I work within a team of people, and our job is to really make sure that the massive investment we're putting into the city has a massive impact, and that we drive through transformation for the city in terms of education and education delivery. My part in that is obviously to look at how the investment we're making in technology supports that. So my job's split up into three main areas. Really I look at the existing contracts and post occupancy work going on. I look at delivering new contracts and driving through build programmes, and I also look at what it is that we actually do with that technology, because critically for us it's not a buildings programme, it's a transformation programme. So we're working currently within a range of broader contexts. These are some of the ones that are particular to our sector at the moment. Obviously the mainstreaming of mobile and social networking services has had a big impact on young people's experiences of learning and their day to day lives, and has had a big impact on schools and school management. There's simultaneously an e-government agenda going on, looking at moving more and more services online, looking at centralising procurement. It's a big e-safety and cyberbullying agenda going on for our pupils and for our staff members, and that's an obvious consequence of a move towards a more open network culture. And there's the carbon reduction commitment, which is a mandatory scheme for those of you who don't know, to improve energy efficiency and emissions from large organisations. The local authority is obviously one of those, and our school estate makes a significant contribution to our overall energy consumption. So it's a huge concern for us in terms of funding and design. And also one of the other areas is obviously the government's agenda, and I've flagged at the white paper the importance of teaching that came out in November last year. And there's two critical factors really around that. One of the main ones is the centralisation of budgets and localisation of decision making to the school sector, to individual schools, rather than to the wider area. And that's playing a part in how we as a local authority plan and offer our services to, and the ways in which we are able to support schools. OK, so we've talked a little bit today about JISC's digital literacy agenda, and that's something that's very close to my heart. In terms of the broader context that we're currently working in, we have a high percentage of learners and young people, unless they're who are living in comparative poverty. It's a significant amount of our learners who are doing so. And we need to ensure, from my point of view, what we need to be doing in order to make sure that investment that we're making in the schools and in technology is a good one, is we need to ensure that learners are leaving us fit and capable to take advantage of the opportunities that technology affords them now. Because not all of our learners are going to be going on to higher education, some of them will be, some of them will be going on to employment, some of them will be going on to entrepreneurship, some of them will be going on to none of those things. But what we can do is we can ensure that they are able to engage in technology in a way that is supportive of their life chances and their opportunities, and that's a critical agenda for me at the moment. So, in terms of digital literacy, I think the question for me isn't, should we be supporting digital literacies within schools? It's this one, it's how can we ensure that we use technology and education not to further disadvantage already for young people and young people. And we know, as use of technology increases, young people and people who are not engaged with, not confident with, not connected to, not able to afford to connect are further disadvantaged. So, I'm going to talk a little bit now about some research that the learner voice team carried out this year. This was a project that the learning engagement section did as a year-long project. It talked to 400 children from 15 schools and they included the SEM schools and the mainstream schools. It was a qualitative activity-based, year-long research program and the age range was from 11 and up to 18 too because some of our schools do have small-sit form colleges as well. So, and as well as visiting those school sites, we also went out into youth clubs, talked to kids in those contexts out of formal school contexts and we also took advantage of Leicester's community media week as well to talk to young people about what their priorities were and what their other priorities were. So, it split up into two parts. I'm going to talk firstly about what their priorities were in the school environment. Now, this isn't specifically a technical question that was asked for them. It was around the school environment, but I think it's interesting to see how technology fits into that and just to see what young people actually want and what they're saying because I think that's a critical driver for us making change happen. So, I need people to engage at this point. I know you're not a shy audience, typically. So, if anybody gets anything in the top five, they win. I haven't got Pringles. They'll have to win something else. So, what do you think young people's priorities about their school environments are? What do you think they really want? Okay, bullying? Anything else about the physical environment? Bright? Colorful. Anything else? Shared areas. Shared areas, okay. Social and learning. Social and learning, okay. So, flexible spaces, okay. Any advances? Toilets. Toilets. Thank you. I'm very glad somebody said the toilets. Access to computers. Access to computers, okay. So, let's have a look. These are the top few, I think 14 or 16 of these. So, number one, more indoor social space. An indoor social space is the thing that is at a premium in our schools because the build money is based on a pupil per area. So, indoor social space is very, very hard unless you're working at looking at designing whole buildings flexibly and thinking really, not in terms of what it is you can deliver in the build, but actually how you can plan and manage those spaces for young people. Number two, better library spaces. Young people are very, very aware of the importance of the Learning Resource Centre spaces. They value them very highly. They want better learning resource spaces. They want comfy chairs. Time to time again they say, that is what will help me focus. That is what will help me relax. Attractive spaces, better use of colour. So, chap up here, who, yes, Fred. Fred Wiens, the prize, well done. Vegetable gardens. Sustainable buildings design and practice, they're very, very keen on what it is that we can get into their buildings that will reduce energy and will support them in reducing energy consumption. Overly keen. The nicer toilets, number seven. Bigger dining spaces with more food choice. Exable classroom places, spaces and furniture. That was the top ten. Now we're on to the less priority areas. But in some ways the more interesting ones as well. More variety in teaching methods. Time and time again they say, we don't like somebody standing at the front going through a PowerPoint. More student input into everything. They're very keen on the student councils improving the work of the student councils and actually finding different ways to engage, different ways to have a say in how their school is managed and run. More flexible use of technology. So there's lots of complaints about having to go to specific rooms to use technology and only being able to use technology within specific spaces at specific times. Greater choice of variety of subjects. More information about subjects coming back. 15.2, better careers information. They felt that they weren't being given enough information about the choices that they weren't being expected to make. And outdoor shelters and classrooms is obviously really important. So what were their technological priorities? This is just asking them about tech. What do you think their priorities are? Keep them right by phones. That's a good one. Once one, ratio computers. And blocking of all the sites they want to get to. Blocking and filtering. Wifi. Okay, so let's have a look. Number one, faster computers. The computers are too slow in schools. It takes too long to get on to anything, let alone find out whether that site's blocked or not. More creative student centre use of technology. That came up time and time again. Why is the teacher the only one allowed to touch the technology in the classroom? Why aren't I able to use the whiteboard? Why can't I do these things? Less use of technology for its own sake. So why are my teachers using PowerPoint again? Less use. More flexible use and access. And this was a very interesting one. This was within the building, again coming back to the point about fixed spaces to be able to use. So it was about Wi-Fi, but it was also about learner spaces. So they talked about spaces within the city centre and they talked about spaces at their homes. Why can't I get access to Wi-Fi in my home? Laptop borrowing and home use was an extremely popular one. I want to be able to take equipment home with me. I want to be able to work at home and do things. Okay, and this was the last 10. So collaborating and learning from young people in other countries was really a high one on their list. They didn't know why everybody wasn't using Skype. They didn't know why they weren't allowed to talk to learners from different countries. Access to local and national decision makers via social media was a huge one. They all want to talk to the mayor. We've got a newly elected mayor with moral powers in the city and they all want to be able to go on Facebook and talk to him and tell him how to do his job a little bit better. But to a range of that as well, so not just local decision makers, they did want to be able to engage nationally. I think that echoes back to the student voice concerns that they had, that they weren't being heard, that they did have opinions, that they wanted to use technology and tech channels to be able to communicate their opinions. They want young people only access. They want spaces that are not for old people and not for almost old people, but are just for young people and children. And they want teachers who can help and use social media and that includes better e-safety advice. They didn't feel the e-safety advice that they were getting at the moment actually fitted with the practices that they and others were joining in. And they also wanted to say in school filtering and blocking, they didn't actually come out and say, we want to free for all, they actually said, no, we understand why some things would be filtered and blocked, but we don't understand why we're not being asked about it and that we can't have times in the day when we're allowed to use things in a responsible way and they can kick us off if we're not using them in a responsible way. So they had a lot to say. So my job really is to take all of that on board really and to push forward with the programme as a whole and also to make sure that those young people's voices are heard and included in the planning. So where we're heading in terms of the work that I'm doing at the moment, a lot of my focus is on the infrastructure, network and connectivity. That's where I'm putting the most money to making sure that we've got really robust infrastructure in place and that we've got good Wi-Fi, that we've got good servers on site, that we've got good connectivity within those schools. So I'm only working within those schools. We are moving like many other large organisations, many universities, many FE colleges. We are moving more into cloud services and storage solutions because primarily of affordability, but I do think there are huge opportunities there that we can take advantage of as well as risks to be managed around that. We're moving towards learner-owned devices because schools are not going to be able to afford to give every student a device on a one-to-one basis and that raises a whole range of issues around management, around security, around safety, around charging, around capacity of the schools to support that many devices. I'm having lots of arguments with builders about floor boxes at the moment. Builders don't like floor boxes, it turns out. Technology and energy reduction is a huge, huge area for us. How do we drive up the use of technology for education while at the same time get people to switch their computers off when they don't really need to use them and use the system smartly to be able to support the user and community-based activities around reducing energy consumption in schools? The broader context, as I said, there's an increasingly school-centred decision-making and budgets going on. We know historically that that doesn't necessarily bode well to small educational institutions who may then be vulnerable to all kinds of claims about the marvels of technology. I don't think it's particularly controversial to say that I don't think Michael Grove has come out as a passionate advocate of technology for learning in the school sector at the moment. That's hanging over us and the reduction in budgets and the rationalisation around that area is really hanging over us now. OK. Nearly finished. OK, so these are the strategic priority areas that I'm working to. I'm not going to talk to them at the moment, but how I'm working is that I have a framed set of priorities which are here that we work to, that we talk with the schools that we look at, that we set actions and we talk about what measures of success and transformation would look like in those areas and then we move them forward. I've talked a little bit about network learning and communities at Berlin last year. I'm happy to talk to anybody about any of those areas and what it is that we're doing in those areas as well. So I'm coming back, really, to the title because I talked about the city as a learning environment and really I'm focusing on the schools and the school environments. Remember when I started out as an ed tech all those years ago at the beginning of time? It wasn't that long ago, but in internet years it was a long time ago. The people that I made connections with and the friends that I made, there weren't people in my city particularly, there were people from Canada, Australia, there were people all around the world and now I can message people through what I name my Wi-Fi channel. Technology and the use of technology has become mainstream. I think it's very much been driven forward by social networking services, but the opportunity to actually look at localised connections, localised networks is actually there now, it's a reality. It's not just me talking to somebody in Canada and people thinking I'm online too much. We have some brilliant things going on in Leicester, some really interesting tech projects and work going on. There's the Citizen Eye and the Citizen Journalism projects that are going on there. There's the Amplified Leicester projects from DMU that are going on. There's the third university stuff that's going on there. There's a whole bunch of stuff and I think what's really, really important is that we stop focusing on just the schools. Obviously we need to make the schools fantastic, but the schools are only one location. What we need is our young people to be able to learn anywhere in their city and we need for them to understand that it is their city. I really think that technology can support letting young people take ownership of spaces that they currently don't feel that they have ownership of and they don't have any importance and they don't have a voice in. Outside of the work that I'm doing on the project I really want to look at how we as a city connect, how we connect the brilliant project, the brilliant people, the fantastic teachers that we have, the fantastic school leaders and the fantastic learners, how we actually connect them and drive forward. Thank you very much.


Hey, Michael, how are you today? I'm fine, thank you. Okay, it's the first time we are having a lesson together. Yeah.  It's a few lessons regarding your freestyle. So, you do try it, right? Yeah. So, you're like an Ironman competitor, or...? Yeah, so half Ironman more. Okay, you are going on the longer distance. Yeah. So, the idea today is to see your freestyle and to see how we can help you to reach better strokes. Yeah. Okay? Okay. Okay, awesome. Can you show me the inner foot? Maybe one or two laps? Yeah. Can you show me one more time? Yeah. And try to relax more, so just finish and do easy on this, okay? Okay. The hips are sinking quite a lot. And there is no glide on the front at the moment. The legs are sinking a little water. His head is like shaking everywhere. Because they mean... You look very fit. I have to say, you look super fit. But in terms of skill for the swimming, there is a huge gap between your looking and your performance at the moment. Maybe for biking and running, you've got much more good level. And for swimming, it would be a big problem if you don't reach like a way where you should use more. It's your usual performance at the moment, okay? Yeah. Okay, so basically, when you're in the water, you should be horizontal, you should be gliding, and you should not be fighting, and you should be very relaxed. And at the moment, for what I see, your legs are sinking, your hips are sinking.  So you need to breathe for your body to become diagonal, horizontal like this.  So you accumulate all the negative points to help you to increase. So today, let's see if you can do very simple tips to be more horizontal. Yeah. Okay? First of all, when you breathe, let's get the breathing. All right. Oh, that's good. Yeah, this is maximum. Yeah. All right. All right. You are super stiff. Okay, so basically, try to be stretching your arms more. Yeah. Fingers to the sky.  What we're gonna do is just push on the wall. Yeah. And glide. Okay? No kicks, no strokes. Just kick slowly. Yeah. Blow your bubbles, okay? And then we go for the streamline on the surface. Okay. We do two times. Okay. So your hips sink immediately in your legs as well. Yeah.  Same thing. Skip your hands on the front, okay? Okay, when you start, you start with your hands on the surface. It's simple. Your fingers far away. Yeah. Then you glide from there. Okay. Put your head below and just let it go. Sinking strength. Speed. Actually, your style needs a lot of speed because I think your density, your PNC is very negative. Yeah. So you just attract. Okay. Push faster. Yeah. Kick smaller and faster. It's a bit too big, so you need to smaller and faster kick. Okay? That's too light.  So you need to feel in your feet your little splash, okay? Yeah. So one more. Very small and very fast for your kicks and no strokes. Just feel. You can mess in the past. Yeah. If it's too tight, let me know, we will fix it better. You know, you're so good, but your body is so heavy for the water here. It's like that. Yeah. I can feel, even when you go, I try to carry you. I feel like, oh my God. Yeah. It's an anti-cap. Some people, they just float. Yeah. I don't know. Not at all. You kind of sing very fast. Yeah. Okay. So now we will do the same things and you keep your hands.  You throw it there.  Pull, elbows up, hands relaxed, throw the stone. Okay? So we will do two strokes only. I execution of being stone throwing and relaxed. And then the kicks. Yeah, always the kicks. There is no more this sound since we start we let it sink. So we do again more about your kicks and try to touch your hands because if you touch the water your hands on the front is sinking.  Yeah. No. If your hands already go down you will follow. Yeah. Keep your hands up. I want to see your skin on the top of the water and I want to see your splash behind. Like two or two straight. It's cool we do small distance. Now we you need to feel it we fix the techniques. Okay? All right. Better kicks this time was less sinking. Your hands okay it's a body. Okay? Yeah. It's not so bad, right? But you have to make the effort for this exercise to be on the surface. So let's say I want this to not be wet almost. Keep it up. All right. Two strokes on there. Okay? How you feel?  I feel better with the kicks because now I feel like I need to touch the water. Yeah. All right last time you don't know. So I used to do the kicks more on the water and I feel that my body is a bit more right. When I do it on the water I still have issues with my hands going in the water. Okay. Now we put all your body at the maximum on the surface. Okay? So legs wet not bending too much and hands higher you're still here. Yeah. Make the effort to put your shoulders up stretch forward it's here okay? Remember the intention. Yeah. Stay on the surface and lie on the front. So don't do this. Okay, let's go. Two steps this time your legs no more. We have to fix the legs right but the hands fall. Yeah. Otherwise we've got the hands right but the legs open up this body. See your stiff right? Yeah. Let me try. Stretching. Yeah. Stretching. Yeah. Okay. That's the idea you need to be more. Okay. We can do it relax more. Okay. Raise. Let it go. Start from the wall. Yeah. We will continue at a small distance until you feel better. When you feel better I give you a good boy for your leg. Okay. I'm okay with this. We go again like this. One. Two. Okay. Two. At least correct the techniques even you are like a bag of stones. Yeah. We will fix it by you have a lot of power that's not a problem. Yeah. Okay. All right. What is good what is wrong? You know by yourself Yeah. I'm sinking. I'm wrong. Yeah. I prefer you to stop at that moment until you continue swimming and fighting. Yeah. When you're training when you're in the race right you are with all the other triathletes it's the race. Yeah. Okay. You don't want to stop you want to finish you're swimming to start where you're good your bike and your run but but then you're on the training side swim only when you're good. Yeah. Okay. So you lose your techniques to the full body. That will just help you for now have to focus on the arms now. Yeah. So same things one and two with the kicks you have to be lazy with your feet. Remember this is your main point you're sinking from the back so keep it up. Breathe at number three we see how you do your breathing first. Okay. Balance because of the full body this is good actually because it will help you to less sink from your legs and you will amplify the wrong movements. Yeah. If you do much you will flip over. So the pull boy is very good tips.  Okay when you turn your head turn you are like this. Yeah.  Yeah.  Yeah.  See then you turn your head you can breathe right. Yeah.  Yeah.   Let's see if it works on the ground okay. Try again. Yeah. We will do like this not number three when you turn yeah down like we just see yeah and your arms to go behind your head I will help you with my hands turn ice so now listen if you pull then you have not speed much yeah and then after turn because you turn after your pull and then after go back with no speed you will drown so now I want you to turn your head turn in the same time and you will go back before your arms pass your face so pull and turn at the beginning go back before your arms pull and turn at the beginning go back before your arms alright we try this one slowly two turn too late my god it's too late I want you to turn when you do this one you that's an habit you have to change this one yeah okay let's go on the other side same things one two I tell you turn you need to turn it's not after straight let's go straight two turn a bit late one slightly late slightly late okay I know you have you have this habit since many many training now I want you to change the moment you turn make it earlier as early as you can you see I'm gonna say one pull two pull turn at the beginning I pull and I turn same time not pull first turn after okay so one two better keep going one two turn okay I think it's correct with your turn now it's like it's time to use your legs to be more horizontal you're sinking with your legs same things one two two one Michael your legs are deep yeah better timing that's I have nothing to say about it I'm happy with what you give me for now okay you need to learn how to relax more yeah but your legs I cannot accept to be like this you can you have to make it horizontal yeah okay it's like it's like you you handicap yourself from the beginning yeah and it's already hard enough for you so make your legs up we start with the splash open and you feel your legs up then we can start the stretch okay that was good you did legs up and then when you turn your head what happens your legs you turn your head it happens like this you're good at that so no you turn your head kick strong on the surface make it still up your legs stay there no matter what splash yes one two splash splash that's it cool that was good difficult unfortunately there's a lot of things to think at the moment okay that's another thing right it should not be thinking it should be feeling so for now it's a lot of new things the more you do it right the more it feels right the more you don't need to think you just need to feel okay so that was good I want the same things legs up when it's up one two turn one two turn with your hands on the surface and you splash always on the surface especially when you turn okay that was good splash turn try to not be like huh you have to be more relaxed the more you are relaxed the more you will swim faster the more you tense yourself the more you will sink it's hard one more time that was good hi if I'm not under your hands like definitely much better than just before continue it was a long way for us yeah I have to tell you the truth no I think you can definitely improve a lot but you have a long way before you got your Ironman smooth oh yeah I know but definitely great because this is very challenging and what I want you is to start to feel this right yeah two and turn and I will try to catch your I will do your legs for yourself after to help you to feel it hi two stretch and breathe alright that's not too bad okay now let me try something we will go slowly this way and I will carry your body so I want you to try to relax as much as possible and don't forget your legs because someone behind will be in charge okay and I just want you to focus on your hands one by one turn at number three two and one I relax two I relax turn at number three one okay relax this top portion okay focus on your arms okay I'm happy with what I see okay there is something very good for you if I carry your legs you can do your hands much more relaxed when your legs are like ah fighting fighting fighting so if your hands get more relaxed less tense yeah it will give you the speed your legs will with the speed fly easier yeah basically the legs in freestyle for try at a long distance is not very proportionate it's more balance yeah but you have so much little speed yeah they just drown you know and for you you can switch energy to bring them up so I will carry your legs you focus on your stroke now try to relax more yeah you know no stiff yeah one glide pull and glide turn at the beginning relax and glide stretch forward don't worry the legs anymore focus on your stroke upper body okay good better turn two turn two turn one okay I'll help you wow hey how you feel yeah it's better right yeah I just I just take away what kills your freestyle yeah which is your your BNC super negating yeah and the fact that you drown your legs and spend a lot of energy yeah yeah okay so we do last time I think for today that will be good enough yeah try to remember today to relax very much discussion your legs drowning we will fix it in few exercise but I think so what I see the more you will learn how to relax the person the more you will got better speed then your legs will just flow out okay so we go back we try to don't stop until the end and if at the end I push you and let you go yeah just keep on the stroke you keep the same momentum yeah feel the sensation alright alright talk to feel better yeah so I feel that I really grab up uh huh so when I get in the water I really come stiff I'm sure okay but the last one was way more relaxed different way more in control because I'm I'm in charge of behind yeah I can tell the difference is huge between when you are alone with your legs thinking and you fight yeah and when you feel like okay I don't have to worry about this part behind me yeah I can focus on my upper strokes yeah and then everything is more relaxed it's so much better for me as well so okay we will do hopefully some more class to make this happen yeah and once your stroke on the top will be super smooth and you have the power here then your legs will just need to be balancing behind you more relaxed the more you tense up that's now you are like this the more you tense up the more you will draw yeah you need to you know chill and relax yeah that was cool thank you my girl thank you we do it again and yeah hopefully next time we'll be even better thanks my girl


So a neural network is the network of artificial neurons. It tries to simulate our human brains and the neural network has many layers of the neurons. And the first layer we receive the input like image, video, sound, text, or anything, then the input data we go through all network layers and the output of one layer will be fed to the next layer. So there are many millions, there are millions of parameters in neural networks and the neural networks can be used to recognize things. For example, like neural networks can be used to recognize that there is a doll or there is a cat in the image. So there is a need to have big data in joining neural networks just like human, just like us. Actually, humans take advantage of big data. Imagine a person perceived like 30 frames, 30 images per second. That means 1800 images per minute and over 600 millions of images per year. So that's why we should give neural networks a similar opportunity to have the big data for the training. Yeah, so there are many, many applications of neural networks like facial recognition and driver's cars. So for example, like the faces detected by the smartphone's camera will be recognized by the neural network or in another application, the driver's car equipped with all the multiple cameras tried to recognize the surrounding environment. So the autonomous car are able to recognize other vehicles, recognize traffic signs, stop sign, and from the recognition the car can change the speed automatically and even doesn't break to avoid any potential accidents. So neural networks were invented a long time ago. Then it went through the long, long hibernation due to all the lightweight models because of the computational cost. So recently it grows again thanks to the advanced computational resources like Graphical Processing Unit, it's called GBU. So that's why now we see the prosperity of neural networks.


This is one of those old time MLB stories that don't make sense and you have to look it up before you believe that it's true. Satchel Page at age 58 shut down the Boston Red Sox. So the story reads in 1965 that A's signed 59 year old Satchel Page as a gimmick to generate fan interest, but nobody told him it was a joke and he proceeds to just shut out the Red Sox for three innings. Obviously I'm like, there's no way this would fly in today's game. Let me check his baseball reference page and see if this was like a real game. There it is, age 58, one appearance, no runs given, three innings pitched. That's on his baseball reference page.


Welcome to this first pattern now in the design patterns part of this module And the pattern we talk about here is the so-called observer pattern. The idea is that you might have a subject You have some part That you want to display in a certain way And you want to decouple the subject itself from For example the display or the behavior so common cases where you have this is for example a data object that you Want to display and if the data changes you want to update display or For example listeners that you have in many programming languages. You have a button and The behavior when you press the button is a different part So these are common things that so that you can evolve them separately and you can dynamically add For example multiple displays for the same data or multiple behaviors multiple listeners for the same button If you're not familiar with it or if you have forgotten it I would really recommend you to take another look at the class diagram syntax because we'll use that a lot here in Particular the object or at the design patterns that we're going through all make heavy use of inheritance and things like polymorphism that depending on if you call the concrete object the inherited Subtype then depending on the language you actually call the update function down here instead of the original one in the higher class in the parent class So this is a behavioral pattern in the the observer pattern. I'll just walk you through what this means we have a subject That supports Attaching and detaching Observers so you can at runtime call this method and say I am an observer I would like to attach myself to this subject and Then the observer itself has an update method So this is how you tell the observer something has changed now imagine a subject changes For example the data changes you do something in the database What happens then is that you call the notify method of the subject and the notify method of the subject goes through a list of all the observers and For each of these observers it basically calls the update method so by calling notify all of these update methods are called and If you call detach again, the the subject simply removes the observer from the list of existing observers now That's sort of the higher level here. Then you have the concrete Observer and the concrete subject and they actually need to know each other So for example, if you implement a button then you have a button listener that knows exactly what kind of state The the concrete class has if you implement some kind of data structure then this information is here How does the data structure look like and the observer needs to know that? Because if you want to for example, let's say you display a bar chart or a pie chart of that data for that You need to know how the data looks like so that's why we have this line in between here The concrete classes know each other So what happens if I call notify? The update method here is called and the concrete implementation of the observer Then calls the concrete get state functions So basically we tell the observer something has changed and the concrete one says, okay I know what kind of subject I'm dealing with I'll call the get state method and I get back the current state So imagine now this is for example, election data Our concrete class is some kind of implementation of this data structure states parties votes and We have an observer that this place this as a bar chart as you often have Once we call the notify the update one here is called of our bar chart The bar chart knows exactly how the data looks like so it calls to get state method and they get state method Turns the state which is the concrete data structure With the polling information and then the observer updates the display As I said, this is common for example for button listeners So for any kind of listeners actually event listeners and programs so for example here you would have a generic class button and You would have a generic class listener and Down here you would have a concrete implementation of the button and a concrete Implementation of the button listener listener, which is for example the case in Java where you can do these kind of things So that's one common implementation of the observer pattern in practice that you might come across In terms of the solid principles what we see here is on the one hand the the open closed principle So these two parent classes are not made to be modified. They're kind of fixed So they're closed for modification, but they're open for extension. So the idea is that you add Things on top of them. That's the open close principle in practice basically and the other thing we have here is Liskoff substitution so The Abstract type subject and observer we cannot any time replace with concrete Implementations and the behavior should remain the same. So that's Liskoff substitution Okay, let's look into another one. This was the first behavior pattern


Namaste, welcome to the next session of our course Practical Machine Learning with TensorFlow 2.0. In this session, we will study about optimization algorithms and their roles in machine learning. We will specifically study a specific optimization algorithm called gradient descent and its variation mainly mini batch gradient descent and stochastic gradient descent. We studied what is called as loss function of machine learning model. We used the term or we use symbol J W B. So, loss function is parameterized by W and B which are parameters of our model. So, just to remind you our model that we considered for linear regression was as follows. The output Y is equal to B which is a bias term plus W 1 X 1 plus W 2 X 2 all the way up to W M X M. Here we have training data with M features and we have a model with M plus 1 parameters and these are the list of parameters. So, we can think of model as parameters by B W 1 W 2 all the way up to W M. We will use W as a vector to represent all these M weights. So, that is why we say that the loss is the function of parameters and in case of linear regression the loss function looked something like this. So, we calculated the loss at each point and the loss was calculated as the predicted value on ith input, the difference between the predicted value and the actual value and we squared it. So, this is the predicted value, let us write this, this is the predicted value and this is the actual value. And just to remind you this I over here represent that this is ith point, this is ith and this is label for, so this is the loss function. So, geometrically, so let us consider there are M plus 1 parameters. So, loss function is essentially a function in this case. So, the loss function can be shown, let us say this is the loss, this is parameter W 1, this is parameter B and there will be several such kind of parameters, let us say W 2, W 3 and so on up to W m and loss will be a surface in M plus 2 dimensional space. So, it will be some kind of a hyper bowl kind of a shape. What we will do is in order to understand this we will take a simplified model and try to visualize the loss function in the 2D space. Let us take a simplified model where there is a single parameter, our data is of the following form. So, we have data D is we have this pairs, we have the feature and the label, we have n such data points. So, we can compactly represent this as we have ordered pair of features and labels, there are n such kind of ordered pairs and each data point has a single feature which is represented by x 1 and our y is a real number. So, this is a regression problem and the model that we use is y is equal to B plus W 1 x 1. So, the loss function is J of B comma W 1 is 1 over 2, we compute the difference between the actual value and the predicted value is a predicted value minus the actual value and we take square of the difference. Geometrically, this loss function looks something like this. So, we have J B W 1 or the loss on y axis, we have weight W 1 on one axis and B which is a bias on the other axis. Since this is a quadratic function, this will look something like this. It is a bowl shape function, it will be a bowl shape function, it will be a bowl shape function. So, what will happen is we have to find out optimal point on this bowl. Let us spend couple of minutes to understand the duality of the loss space and the model space. So, we have a model where we have input x 1 and we want to predict the value y. Each of this point on this surface, if we take this particular point, this particular point, let us show some data points here, these are data points. If we use this particular point over here, this point would correspond to a line. This point is represented by two numbers which is W 1 and B and for W 1 and B, it gives us a specific loss and our model also has two parameters which is W 1 and B. So, for this specific value of W 1 and B, we get such a model. If we select another point on this surface, let us say this particular point. This point will represent some other line. So, let us call this as and let us call this as point 2. So, this is W 1, 2, this is the second point and this was the first point. If you choose some other point, this might represent some other line, let us call this as point number 3. This is essentially a line which is W 1, 3rd point and B 3 and for each one of them, there is a loss and in order to recall what the loss is, so for this particular line, for the third line, the loss is essentially a distance between the actual value and the predicted value. And this is the actual value, we calculate the difference and we take square of the difference. So, we find out all these differences and sum them up and that represents our loss. So, if we sum all these numbers up that you will get a loss corresponding to W 1, 3 and B 3 which is some number on the y axis which is a loss. So, this is very important to understand the duality in the loss space and in the model space. So, point in the loss function represents a model and we want to get a model that gives us the minimum possible loss. Is our objective clear? Our objective is to find a model or model parameters in such a way that the loss incurred due to those parameters is minimized. So, of course, I mean you must be wondering that you can also try some kind of a brute force approach where you will explore this particular space and try to find out points that gives the minimum value of loss. But this is not really efficient. If we take let us say a parameter space of or the loss function with M parameters with the value of M being very large and large M's are kind of their routine in our day-to-day machine learning problems. So, if you are trying to solve this problem in the context of M which is some large number then you know brute force is almost impossible. So, we cannot really do brute force. So, we have to do something more intelligent and you know the way we are phrasing this particular problem we are saying that we want to find the values of parameters in such a way that the loss function is minimized. So, this is a minimization problem find W and B or find parameters such that the loss function is minimized. Let us see how to do that and let us first develop the intuition of it and then get into the details of our first optimization algorithm which is gradient descent which is workhorse of machine learning algorithms we will see that in a minute after understanding the intuition behind it. So, what is our learning problem? The learning problem find W and B such that loss is minimized and loss will represent with j. You want to find out the values of W and B in such a way that j is minimized. Let us start to understand how we can do this, so what I will do is I will again consider our linear regression model Y is equal to B plus W1 X1 and in order to give or order to keep the expression simple we will assume that B is equal to 0. So, we get a very simple model which is Y is equal to W1 X1. Now our job is to find out, now the optimization problem is find out W1 such that j of W1, B is minimized. So, there is exactly one parameter here because you have already set B to 0, so there is exactly one parameter and now we will see, we will first visualize how the loss function looks like. So, loss function is parameterized by W1 or the value of W1, for each value of W1 we get some loss and since we have a squared error, mean squared error or a squared error as a loss function, so you can see that it is a bold shape function. This function in the language of mathematics is called as a convex function. So what we will do is, so essentially what is happening here is for each of the value of W1 there is a corresponding value of the loss and you can visually see that this is the point where loss is minimized, where there is the value of loss is minimum. So since this is a problem with a single variable or with a single parameter, we can visually find it, but the problem here is if we have multiple parameters, we cannot even visualize the loss function, how can we algorithmically or how can we programmatically find out this particular point over here. So, what is given to us is we know the loss function and we know, we essentially know the loss function and we want to find out the value of the parameter such that the loss is minimized. Now there is this particular method which is called as gradient descent, gradient descent helps us to do this programmatically. Let us try to understand gradient descent intuitively before getting into the details of the steps involved in the process. So what happens here is, we first initialize the value of W1 to some random value. Let us say I select this particular value of W1. So for this particular value of W1 there is a loss associated with it. So this is the point where, so this is the point where my initial guess landed. So my initial guess is this for the value of W1 and at this point what we do is we calculate the loss. So what is it representing? I am selecting, I am randomly selecting or randomly setting the value of W1 to some parameter. So this will actually get me a model. This will actually define a model for me. So remember the duality of the loss space and the model space. So we have x1 here and we have y here. Let us say these are the points and we have a model which is a line passing through the origin. Now what we do is, there is a difference between the predicted values and the actual values. And what we do is we calculate square of the difference and sum them up across all the points and get loss corresponding to this particular model. Now so the first thing that we did is we randomly initialize W1 then what we did? We calculate the loss value, we calculate the loss. So we know the loss. Now this is a point where we want to reach. How do we really reach this point from here? Now think of this as a task that is analogous to let us say you know climbing down from the mountain top. So what happens is while we are climbing down the mountain top, we are let us say at a specific point we look around and find out what is the direction that will take me down to the valley. So gradient in gradient descent we exactly do it at a particular point on the loss surface. So at this point what we will do is we will calculate the slope or the direction in which I should be moving the direction of slope. So let us say this is a slope at this point. So this is a tangent to this point. So we can calculate slope of this tangent and we get the direction of the slope. So we will move in the direction that is opposite to the slope. So the slope is negative here. So we will move in the negative directions, we have to move in this direction. So first we will calculate the loss, second is we calculate the gradient. And once we know the gradient, the next question is how much we move from the original point so that we reach the valley. So there are multiple options that we have. We can move or we can step, we can have a longer strides or we can take shorter strides. So the length of the stride it is decided by a parameter called learning rate which we denote by later alpha. So learning rate helps us to control how long strides are we going to take from a particular point. So let us say if we are at this point and if we have some learning rate we are going to take a stride and we will end up over here. So this becomes a new point and what we do is we repeat the same process that we did at this point, at this point we first get the predictions on this particular model, we calculate the loss and then we calculate the gradient. In order to get the loss we should also have predictions. We need to get predictions at every point. As you can see here this is a prediction for this particular point, so predicted value and actual value. Because in order to calculate loss we need to know what is the actual value and what is the predicted value. So we first make the predictions with the value of the parameter, we substitute that in the model and we do the predictions and based on predictions we calculate the loss. And after calculating the loss we calculate gradient of the loss. So we will again do the same thing at this particular point and we see that it is the direction of the slope. So we will be moving in this direction by taking some step. So let us say we come here. Now you can see that as we approach this particular point which is our golden point or point where the loss has got the minimum value, as we go closer and closer to that point the derivative or the gradient will become smaller and smaller. At this particular point the gradient will be 0 because it is a minimum point. So you can see that as we move closer to the gradient or the derivative or the gradient as we move closer to the minima the gradient value will become smaller and smaller. So our strides, so we have a constant learning rate but our gradient is so we calculate gradient we have learning rate and then what we do is we have a new point. So let us say W1 nu is equal to W1 old minus learning rate times the gradient. So you can see that learning rate is constant, gradient is gradient becomes smaller and smaller. So we will be making eventually shorter and shorter stride or stride will become shorter and shorter as we approach the actual minima. Is this clear? So this is how we reach to this particular point. Now you can work yourself, you can take a pause here and you can work out yourself how this particular calculation work if I randomly initialize the point over here. You can see that the gradient, this is the direction, this is the slope and we will be moving in the opposite direction of gradient. So we will be, since gradient is positive here we will be making, we will be moving in the opposite direction. So whatever value we have we are, so here the gradient is positive. So what will happen is since gradient is positive at this point we will be effectively moving in the opposite direction because this is the value of W1 old, we are going to subtract something from it. So we will be moving in this particular direction if I am starting from here. On the other hand when we started from here, here the gradient was negative and since we are going to move in the negative direction of this. So you can see that gradient is negative, this negative and negative becomes positive. So we move in the positive direction or we have some value, we are adding something to it. So we are getting a value which is greater than the old value. So if we start from here we are going to get the value of W1 which will be greater than the previous value. If we start over here we will get values of W1 which will be lesser than the previous value. So this is the intuition behind gradient descent. I hope you understand this clearly, if you have not understood it, it might be a good idea to take a pause, go back in the video and check it out. And once you understand this then we will move into the next part where we are going to write down the steps that are involved in the gradient descent algorithm. So let us write down steps in gradient descent. Now what we will do is we will try to generalize the gradient descent for M parameter case. So when we are trying to establish the intuition of gradient descent, we did it intentionally with a single parameter so that it is easy to geometrically show what is happening. But when we go to the M parameter setting it becomes difficult to visualize what is happening. So let us consider a setting where we have M plus 1 parameters in the model, BW1, W2 all the way up to WM. And we are trying to solve for a regression. So the model is y is equal to B plus WI xi. So this is a linear combination or linear combination of the parameter and the future value and this is a short form, this is a short hand form of writing the model. And obviously our loss function is the squared loss which is done over N examples. So the first step is we randomly initialize BW1, W2 all the way up to WM. So we randomly initialize all the parameter values then we are going to repeat until convergence. We will see how to identify that we have converged to a solution, repeat until the convergence. We first use all these parameter values and we predict y hat for data point this quantity is nothing but y hat. So we calculate y hat or the predictions first then we calculate loss, calculate loss which is J of BW. We know that the predicted value and we know the actual value based on that we can calculate the loss. Then we calculate, so we will take, so is this clear to everyone we will see how to calculate gradient of loss. Fifth step is B new is equal to B old minus alpha times the value of gradient. So gradient with respect to B with respect to W1 and we do it for all the parameter values WM old with respect to WM simultaneously. This part is very, very important. Note that when we are calculating, so couple of points note here we are calculating these gradients with respect to each of the parameter values and we are notice that this is not a equal to sign. We are using some kind of a other notation where the effect of this is we are setting the value of B to a new value which is coming from the equation on the right hand side in this case which is this equation and when we are calculating gradient with respect to W1, we are not going to use this B new, we will still be using the value B old and all the old values for all other parameters and we change the values from old to new right at the end in the step number 7. So this is what is called a simultaneous update. So this is important to note that all these parameters have to be updated simultaneously at the end of the loop. And then we again go back to 2 and go to step 2, we check for the convergence and we essentially repeat. So what happens after this step is we get a new point on the on the loss surface and we repeat the same process at that particular point in the loss surface. So this is the basic gradient descent algorithm or a sketch of gradient descent algorithm for your reference. We have not yet talked about how to determine the convergence of this or how to calculate the gradients which we will see in the next session. Thank you.