Udacity AI Nanodegree Progress and Bayes' Rule Explained | Learning Intelligence 11

The host works through Bayes' rule using a meningitis example, then shares study habits like phone removal and gym breaks while tackling Bayesian networks and hidden Markov models. Project 4 will use HMMs to recognize American Sign Language gestures.
Chapters
Welcome back, learners. It's Learning Intelligence Episode 11. Pretend that's two ones, not, not the peace sign. Well, actually, yeah, the peace sign, not the number 2. Peace to you. Let's start this episode off with a little challenge. So this is at the beginning of the probability class of the Udacity Artificial Intelligence Nanodegree, and I got this question wrong. And now I don't expect you to read it now. I'll put a screenshot up and so you can pause it and try to answer the question for yourself. Otherwise, I'll leave the, I'll leave the actual answer in the description. So this episode, I'm going back over the classes I did last week, the probability Bayes nets, Bayes nets inference, and hidden Markov models. I'm going back over them again so they cement in my brain for the final project of term 1, which is using hidden Markov models to detect American Sign Language, so different symbols of sign language. And now I, I like this sort of project. I like these sort of projects in artificial intelligence because to me, I don't have a need at the moment to learn American Sign Language, but if I can build an intelligent agent to recognize it for me, I would happily use that intelligent agent to help me much like things like Google Translate. It's getting so good now that I know there's plenty of benefits to learning another language, and frankly, if I'm honest, I'm too lazy to try and learn it for myself at the moment. I don't have a fundamental need to learn another language, but if I can use Google Translate to help me communicate with people from other parts of the world that don't speak English or don't speak any medium that we can communicate on, I happily use that. And I think that's another reason why I like artificial intelligence is because we only have limited bandwidth as human beings, right? So, there's no way you or I could learn everything there possibly is. But with the help of intelligent agents, we can get superhuman intelligence in fields that we wouldn't even think of learning about. That's one thing that fascinates me about AI. One major thing, there's plenty more. And anti-distraction tip, my iPhone is in my drawer. It's not even on the desk. I keep it in here so I can't see it, so I'm not distracted, so I'm not trying to get into to use Facebook, use Instagram, use Snapchat. Although I love those services, they do distract you or distract me certainly. From, from more important work at this stage. I do believe they have a place though. They do have a place. That was a long introductory clip. I'm gonna head off to gym, give my brain a break, get some blood into my body, come back, finish chapter 13 of Artificial Intelligence: A Modern Approach textbook. I've only got a few pages left, so learning lots of cool things about Bayes' rule actually. And a lot of probabilistic AI is based off the simple rule of Bayes' rule. Let's check that out. So what's so cool about Bayes' rule? Well, Bayes' rule is used in a lot of probabilistic AI. And I've done up a few slides here that we'll go through and hopefully give you an entry-level understanding of where Bayes' rule can be used. So let's jump in. Slide number 1: Bayes' rule is useful for determining an unknown probability of an event occurring when you have good probability estimates for related events. Now, that was a— in my opinion, when I first read it, a lot of jargon, but I understood it much better when I went through an example. So let's look at this. The way I understand Bayes' rule, or the way the textbook sort of lays it out in a, in what they call a simple case, is Bayes' rule is the probability of a cause happening given the effect. So to work this, this probability of the cause out, you can take the probability of the effect given the cause times the probability of the cause divided by the effect. So again, Fair amount of jargon there, but let's go, let's do a real-life example. Where could this actually be used? So, let's say, pretend you're a medical doctor for a second and you want to work out the chances of someone having a certain disease based on their symptoms. So, the disease would be the cause and the symptoms would be the effects. We have people with meningitis have a— remember, you're a doctor now. People with meningitis have a stiff neck 70% of the time. So, a doctor knows that. And 1 in 50,000 people have meningitis, and 1% of patients come to the doctor with stiff necks. So knowing this, knowing these factors here, what is the chance of a patient with a stiff neck having meningitis? And so using Bayes' rule and the equation we just went through, we can adjust it for our scenario to work out the probability of the disease given the symptoms. So what's the probability of having meningitis given the fact that the patient has a stiff neck by taking the probability of the patient's symptoms given their disease, the times the probability of the having the disease over the probability of symptoms. So again, let's see this in action. So remember, people with meningitis have a stiff neck 70% of the time. So this means if we let S equal stiff neck and M equal meningitis, The probability that someone has a stiff neck given the fact that they have meningitis is 0.7. So 70% probability is 0.7. And now, 1 in 50,000 people have meningitis, so let M equal meningitis. So that means probability of M equals 1 in 50,000, uh, 1 divided by 50,000. And the probability of people having a stiff neck is 0.01, so 1% of patients come to the doctor with stiff necks. And so we want to work out what is the probability of a person having meningitis— so M equals meningitis— given the fact that they have a stiff neck. So we can use these prior details to work out the probability of this occurring. So we just substitute into the equation, we go back up here. The cause is meningitis, the effect is the stiff neck, and I'll let you fill in the other details here. But we sub in the numbers here, so probability of a stiff neck given the fact they have meningitis, 70%, so 0.7, times the probability of meningitis, which is 1 in 50,000, divided by the probability of someone coming in with a stiff neck is 1% of patients, so divide that by 0.01, and that gives us a probability of 0.0014 chance that a patient coming in with a stiff neck has meningitis. So, in other words, 1 in 700 patients who come in with a stiff neck will have meningitis. And so, that's just one example of where, or a simple example of where, Bayes' rule can be used to work out the probability of one event occurring, given the known, or using the known probabilities of related events occurring. So we worked out the probability of a patient having meningitis given the fact they have a stiff neck by using the known probabilities of the fact that 70% of patients with meningitis have a stiff neck, 1 in 50,000 people have meningitis, and 1% of patients come to the doctor with stiff necks. And now, of course, in the real world, you won't always be given all of these probabilities. They won't be known. You have to work them out. The process can be a lot more involved than what we've just gone through. But that was just one simple example. I've been reading for about an hour or so and I'm starting to almost fall asleep on the book. It would probably be a comfy book because it's so thick. I don't know if you can see, but I'm reading about— I'm up to the chapter Hidden Markov Models, which is aligned with what I'm learning at the moment in the Udacity classroom where I'm revising the classes before Project 4. So I've gone back through probability, gone back through Bayes nets, I've gone back through inference and Bayes nets, and now I'm up to Hidden Markov Models. But I'm reading the required readings first. But I'm almost about to fall asleep. I'm going to have a 10 to 15 minute nap and see if that recharges my brain. Maybe go for a little walk and then get back into it, because I figured there's no point me pushing on with reading if I'm not going to be retaining the knowledge. I'm going to let the subconscious do the work and let all this info about hidden Markov models build its own neural pathways in my brain while I have a little nap. Having a break was the right idea. After having a lie down for about 10 to 15 minutes or so and then going for a walk, doing some stretching, doing some yoga, taking my dogs for a walk, having about a I don't know, hour or so break just to wake up. I was almost falling asleep before in the last clip. I came back and finished the reading I was doing in the textbook. Up to Kalman filters. So I've just finished the Hidden Markov Model section in the AI Nanodegree. I'm gonna have to, sorry, in the Artificial Intelligence: A Modern Approach textbook. Gonna have to go back over it because there was a lot of tough concepts. I can't even get the words out. Tough concepts are tough words to say in there. Definitely have to go over like matrix multiplication and vector multiplication, whatnot. Just need to refresh those. I'll probably use Khan Academy for that. But highly recommend, if you're studying and you're falling asleep, get up and move around or just have a nap. Have a 20-minute nap or something like that. It works for me every time. When I try to push through, the law of diminishing returns kicks in. I get to a stage where I'm so tired, but I want to keep studying and I keep studying and I get more tired and the study's not working because I'm going— I'm reading the same thing 4 times over again. It's not sticking. If you're tired, if all you can do, all you can think about is sleep, bite the bullet. Take a 20-minute nap, get back into it. You'll be far more effective than if you keep pushing through. My brother graduated from high school last night and they gave him this plant, but I think I'm going to try and claim it. I think it's a sunflower. I always wanted something green in my room since I spent way too much time in here. Not that it's a bad thing, I like it in here. This is my sanctuary. I've showed you this before. There's my couch, my nap bed or yoga mat, standing desk. Got the setup here and this is where reading, writing gets done. I just finished reading actually. I got emailed a couple of days ago, a book proposal, if, if I could review a book proposal from— I think it's Manning Publications, one One of the editors reached out to me. I'm not sure how they got my contact details actually. It must have been through one of the online mediums that I publish through. And asked me to review a book proposal that they'd got on generative adversarial networks, or GANs. What we covered in the deep learning Nanodegree, or covered in a little bit, a little bit of detail. And asked for my opinion on whether or not the book proposal was up to scratch, and whether or not the authors were the right authorities to be writing this kind of book. And I'm completely blown away. Like these authors, Jacob, he graduated from Oxford University and has worked worked with a company that's partnered with Reid Hoffman and Google's DeepMind, and Vladimir has been in Y Combinator, a Y Combinator startup, amazing people. So I'm only new to this world and I'm getting reached out to via email with these sort of things. And this is opportunity, I mean, it's not a paid opportunity, but I mean, this is where they start from. So what I'm trying to say is, if you're trying to make it in the world, in the developer world, in the creator world, I know I'm still a very entry-level creator, let's just say that. The value of putting yourself online is that you get to be a part of a community. If you don't fit in in your local community, and I, to be honest, I don't fit in in very many of my local communities, so I'm sort of, I'm trying to make my own, and that's why I put a lot of these works out online, that's why I'm sharing my journey and whatnot. Trust me, it's daunting putting yourself out there the first time, but once you get used to it, you wouldn't have it any other way. But anyway, that's gonna wrap up Learning Intelligence, Episode 11. Next week I should be working towards Project 4, the last project of Term 1 of the Artificial Intelligence Nanodegree, so I'm really excited for that. We're gonna detect some American Sign Language using hidden Markov models. One more thing before you head off. Don't forget to subscribe to my channel. It would mean the world to me. Or if there's anything in particular you'd like to see in a future video, or even if you have any advice for me— how can I make these things better for you?— leave a comment below. I'd love to read them. I look forward to hearing from you. We'll see you next week, and as always, keep learning!
More from Daniel

Small Language Models (SLMs) Are the Future: Fine-Tuning AI That Runs on Your iPhone

Introducing Sunny - A MedGemma-Powered Skin Health Tracking App (Kaggle Competition Entry)

Benchmarking: NVIDIA DGX Spark & NVIDIA RTX 4090 | Part 4 - Comparing the results

Benchmarking: NVIDIA DGX Spark & NVIDIA RTX 4090 | Part 3 - Running LLMs on the RTX 4090

Benchmarking: NVIDIA DGX Spark & NVIDIA RTX 4090 | Part 2 - Formalizing the tests

Benchmarking: NVIDIA DGX Spark & NVIDIA RTX 4090 | Part 1 - Creating a series of tests

Local Multimodal RAG on the NVIDIA DGX Spark | Part 4 - Publishing our demo to Hugging Face

Local Multimodal RAG on the NVIDIA DGX Spark | Part 3 - Putting it all together


