What I do when I get STUCK on programming problems | Learning Intelligence 24

Daniel Bourke is stuck on a sentiment-analysis assignment where his bag-of-words features won't shape correctly. He steps away to read Deep Learning with Python and consult NLP resources, uses the Pomodoro Technique with 5-minute outdoor walks to let his subconscious work through it, then plans to move his model to GPU via AWS.
Chapters
Bit of a roadblock, running into errors galore on the project I'm working on at the moment. So I think I'm gonna call it a day for coding, but get into some reading of the AI textbook that I've mentioned in the last few videos, Deep Learning with Python by François Chollet. But let me show you what I've been up to. So I've been working through the sentiment analysis class on the Udacity Artificial Intelligence Nanodegree program NLP section. What we're doing in here is essentially going through a whole bunch of IMDb comments. So here's a bunch of words just all split up into different, different vectors and whatnot, and we're trying to figure out what kind of sentiment are they. Are they positive comments? Are they negative comments? And where I'm stuck at the moment is, for the life of me, I can't get this bag of words features thing. I don't even know how to describe it right now because my brain's in the study. Can't brain today, I have the dumb. Let's just say it's not the right data type. It should be, or the array is not of the right shape. So that's what I'm working on at the moment. I've hit a roadblock. I've worked through it for— I've posted some questions in the forums, in the Slack channel. We'll just wait till we'll see what that happens. If not, I'll just continue with it tomorrow. I think that's a good takeaway. When you're stuck with it, don't be afraid to sort of take a walk away from it rather than sitting there and trying to trudge through the trenches all the time. But I've got something lined up for tomorrow to help me out. A blog post on Carrots of how to introduce, or a 10-minute introduction, sorry, to sequence-to-sequence learning in Carrots. The documentation for Keras is absolutely amazing. I'll link this, this post in the description for you. We've got one more over here, which is Machine Learning Mastery: Time Series Prediction LSTM Recurrent Neural Networks Python Keras. All the keywords there on this one, and I'm going to read through that tomorrow as well, and hopefully, hopefully it will help me out get through the problem. If not, we can do it. Probably wondering why am I walking around the backyard, and I know, well, this is my backyard, so welcome to that first of all. And I know I probably look like a madman, but what I've been doing the past week is following the Pomodoro Technique, which is studying for 25 minutes and then having a 5-minute break. But instead of that 5-minute break, rather than just sitting there and doing something, I'm getting out outside, getting some sunlight. That's why I've got no shirt on at the moment. And getting walking around, I'm kind of summarizing what I've just learned in that 25-minute block in my head while I'm walking around. And what I've been finding is that it's, it's been really good. So it's when I, when I run into a problem, like the 25-minute time frame is, is not actually that long. So if I run into a problem, I can think about it for a bit and and then I can move myself away from the problem and come outside and I kind of run the, I replay it back in my head. Not all the time, sometimes I'll just walk around thinking of nothing really and just letting my subconscious solve it. And then I'll go back in and I know that it's only 25 minutes until my next break. And I'm not looking forward to having the breaks, I sort of am, I'm sort of not. But it really, it's a really good way I think to one, get some physical activity in your day. So I do about 5 laps of the backyard. I don't really like sitting down all the time. Of course you're getting physical activity, getting some sunlight from the outdoors rather than being inside all the time and sitting down. And thirdly, you can— I'm at least finding it really good to solve problems. And you'll notice, like, if you look up any, any high-level thinker, like Steve Jobs, for example, he took all of his meetings on walks. So really, I'm just taking information from people who've done it best and trying it out and seeing if it works for me. And so far it has. If you're stuck on a problem, Go for a walk. I'm finishing off the day reading a fabulous blog post by Seb Ruder. I'll put the link in the description so you can read it too. And I'm trying to use my iPad while looking through the camera. Not a great idea. Anyway, it's about best practices in NLP. And so, Seb Ruder is similar to Andrej Karpathy in the fact that they both— or Andrej Karpathy's finished his PhD now, but I believe Seb's still doing his PhD in natural language processing, whereas Andrej Karpathy, I believe, did it in, uh, computer vision or convolutional neural networks. And he's got a class from Stanford that's available online. Blog post is very well written. His blog is amazing. Oh, both blogs are amazing. Karp, Andrej Karpathy and Seb Ruder. So I'll put links to both of them in the description so you can check them out. One thing, one takeaway I've got so far, the major takeaway, a lot of it, it's probably a bit out of my depth for now, but I'm just sort of getting my head around it, getting the foundations there so I can use the best practices in my future NLP models. And my favorite thought so far is the running joke is that LSTM with attention will yield state-of-the-art performance on any task, which is kind of similar to the model I used in the sentiment analysis class on, on the Udacity AI Nanodegree just now. And I'll quickly show you. I stopped it running. Oh no, what's this? Notebook changed. Okay, cancel. If we go down here, I might skip this in the actual video. Okay, yeah. So I stopped the model here. See how training time— this is ETA, so this is training time, by the way. So it would have taken 25 minutes for one epoch or longer. It's already about halfway through. So let's say an hour for one epoch because it's training on the CPU of this little bad boy. The CPU of this machine can't really handle it. So I need to run it on a GPU. And that's what my next task is. This might be this week or next week. I'm not entirely sure. Run my code on a GPU. May need a key pair for this. That's Amazon AWS talk. There's a guide to do it on Udacity, that's a massive link. And this is my next step, so I'm putting in my next step notes. Once I wrap up for the day, I try to have some notes in there or tasks that I can do the next day, so I'm not sort of running around like a headless chook. I'm gonna go work out. What say we wrap up this video with some shoutouts of the week? So these people either reached out to me via one way or another, whether it's YouTube comments, LinkedIn— actually, LinkedIn is really booming at the moment, so if you want, connect with me on LinkedIn. I'm finding it really, really resourceful in terms of learning from some great people. So, LinkedIn, link will be in the description. I think my handle's Mr. D Bourke. I'm not sure how LinkedIn works. Otherwise, Twitter is always good, @MrDBourke, and my email is daniel@mrdbourke.com. So, in no particular order. We have a big shout out actually, first of all, to Alex Taboul. Thank you so much, a new Patreon. Boom! Your contribution means the world to me. Thank you so much, Alex. It's people like you and of course everyone else that keeps driving me forward to make these videos and to keep on improving my craft. I'm trying to— make sure you guys let me know if I could do any better, okay? 'Cause I wanna keep improving these. I wanna keep bringing you more value. So, leave a comment, send me an email, something like that. Can I improve? Thank you so much to Alex. Next of all, we have Shaikh, and of course, my friend Shaikh, thank you so much for your constant messaging to me. Keep doing what you're doing, brother. Study hard. You're on the right path, and I know it can be hard to balance studying AI with homework, but you'll figure it out. You're a smart kid. I know you will. And Arjan and Carlos, thank you so much for your messages on LinkedIn. And as I said before, guys, LinkedIn is becoming a treasure trove of resources. I'm really trying to step up my game there, whether it be whether it be messaging, whether it be sharing what I'm, sharing what I'm up to. And Carlos, thank you for the resources, that Google Machine Learning course on Coursera, or Google Cloud course, I can't remember exactly which one. I'm really glad we could help each other out with that. Arjun, thank you again for, again, another course on Coursera about data structures and algorithms, and referring to one of my past videos where I said I had to improve on that. So thank you so much for that message. Um, I'm definitely going to look into that data structures and algorithms course after I finish the AI master's degree to step up my programming game outside of AI. Question of the week. Well, last week's question of the week winner was Sarab, and Sarab again, that's 2 weeks in a row. So well done, my friend. Thank you so much for contributing your answer to that. This week's question of the week: in light of of all the learning we've been doing and all the sharing of resources we've been doing, what is your favourite place to learn from people or learn new things? Like, is it YouTube? Is it right here? Are we on the— are we on your favourite learning platform? Or is it something like LinkedIn or Twitter or Udemy? Something like that. Where's your favourite place to go and find people who are interested in the stuff you are and to learn from them? Mine at the moment would have to be definitely YouTube, and as I said before, I sound like a broken record, LinkedIn, and of course Coursera. Udacity. They're my favourite. So, what's your favourite? Best answer will get a shout out in next week's video. Finally, next week's video I'm going to be working through the NLP capstone project of the Artificial Intelligence Nanodegree, and that is a machine translation project. So, essentially building a recurrent neural network to translate English text into French, and I speak about a total of 2 words, bonjour, bonsoir from Mr. Robot, bonsoir Elliot, leave a like if you know what that scene I'm talking about is. That's about it, that's the 3 words I know in French. That's what fascinates about, fascinates me about AI, I'm talking too fast, aren't I? What fascinates me about AI is that it has the power to learn things or help people learn things that they might not have the time and resources to dedicate to learning it. So if I can build an AI system to help me speak French, I'm all for it. As always, thank you so much for watching and— 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


