Full body workout while my machine learning model trains (join in)

Daniel Bourke does a 20-minute Tabata workout while training two object-detection models on Google Colab and Cloud Platform. He monitors loss curves and precision metrics in real time, running one model from scratch and another with transfer learning on 35,000 images. The workout is push-ups, mountain climbers, lunges, and squats in 30-second intervals.
Chapters
Can you hear the fans on this thing? It's pumping. I'm training two models at the moment. We've got one here on Colab, one on JupyterLab. What I figured is that it's day 11 for Repsaroni, y'all thought, and it's also Friday. You know what that means? So while my model's training, my body has to be moving. While my model is moving, my body has to be moving. So that's what we're going to do today. We're going to be training. I'm going to monitor this training because I've got a couple of experiments running. And we also need to do Reps for Rona, day 11, of course. We need to get our bodies moving. So let's do that. We've got something special, a nice surprise other than monitoring the model training. Have a look at this. Look at this. What's going on here? Look at this. Look how many iterations. I'm going this for 20,000. We're almost at halfway. Well, 5,000 iterations and look at this loss curve. See, the ideal position for that loss curve is to go down, which it's slowly, it's trending down. And I want this one to keep going up like it is. There we go. So that's average precision. This is part of my Airbnb series. As long as these two curves go down and that one goes up, average precision, we are good. So while my model is making gains, let's make some bodily gains. We have, we're gonna mix it up today because, as I said, it's Friday and you know what that means. So, let's do it, but I'm gonna keep the mix-up a little bit of a surprise. See if you can guess it as we go through. And because it is day 11 of REPS FOR RONA, the first video we did a nice and simple bodyweight workout. What we're going to do is replicate that. We're going back to basics. That can be the theme for today. Back to Basics. Sometimes you try new things, other times you get back to basics. Let's do it. I've been sitting down for way too long today. I'm excited to move. We've got push-ups, kick sits, mountain climbers, lunges, bodyweight squats. Nice and simple. Let's get a pump. Starting your Tabata workout. Y'all ready? Get ready. I'm ready. We got push-ups first. Remember, we just go for the 30 seconds. We keep moving. We're doing reps for Rona. Keep going, push-ups. Let's go. Oh yeah. Yup. Keep going. Rest. That felt like about a million. Far out. All right, push-ups done. One set. We've got kick sits that are next. We've got a ghost behind my door. How's the model going? You know, I think it can get about 100 iterations per minute on there. I'm running on a Tesla P4 GPU. I believe Colab is using the same GPU as my Google Cloud Platform. So Colab is free, Google Cloud is paid for. We've got kick sits. Exercise. Down on the ground, my hips are going— oh yeah, I thought so. My hips are nice and tight. So someone left a comment on a previous video, I believe it was Hamad, shout out to Hamad, asked why does one of your hands come off if you're doing this movement? And that's if you have tight hips or lower back. So my hands used to— one of them used to come off the ground while doing this exercise. And so after holding in this position for a long enough time, your hips and lower back start to loosen out. You can also do hold a lunge position. What happens when you sit down for too long, like me training these models, Everything gets all tight, and so you need to counteract it with movement, with movements that stretch out your hips, movements that stretch out your glutes, movements that stretch out your lower back. Now we have— Exercise. Mountain climbers. These are also great. So, in a plank position, one leg up, back, up, back. That's it. We're going just nice and calm for this. First iteration. We treat the first round as our warm-up round. That's it, keep going. Up, beautiful. That's it, right up. Keep it going. Yes, nice. So I heard some news that the US— I've tried to stay away from watching too much news about coronavirus and that sort of stuff, like little bits and pieces, because frankly, it takes up too much of your headspace. We discussed this in previous Reps for Honour day, that fear is the mind killer. And I saw that Trump, President Trump said that the US wants to be open for business on April 15th, which is Easter. And I, we'll come back to that in a second. Exercise. We have lunges. So, let's go. We're going to alternate right, left. How's the model doing? Forgot to check that. See, this is what you have to do when you're a doctor of machine learning, is you have to figure out what to fill your time with whilst your machine learning models are training. Movement is one of the best options, of course. Rest. Wonderful. So where are we at? Oh, we're nearly at 5,000 iterations. It's just saved a checkpoint. So come over, look at this. We've got— see there? Saving checkpoint. So every 5,000 iterations, we save a checkpoint. Curve, loss curve, still going down. Average precision still going up. Tick tick. One of these models I'm training Detectron 2 from scratch, and the other one I'm using transfer learning. Now we have bodyweight squats. I completely forgot to talk about President Trump wanting to open the US back up on April 15th, but that's going to be— it sounds like a fairly optimistic date according to what— keep going with the bodyweight squats, don't just listen to me, you got to move. Let's go, keep going, feeling good. Ah, that feels so much better. So much better to get up and start moving. So, sounds like a fairly optimistic date, Easter, but I think it's a good idea, right? You'll be, a lot of experts will be saying, "Oh no, you shouldn't have that date. You should, it's gonna peak and all that stuff." But have you seen what people are capable of when you give them a deadline? I wouldn't like, I would hate deadlines more if they didn't work. So now we are back— exercise— push-ups. Let's go, 30 seconds. We're going nice and slow for this set because we went pretty fast on the first one and that felt like we did about a million. Come on, hold it. Up, down, up, down, up, down, hold, up, Down, up, down, up, down, up. Rest. Wonderful. Come back over here. You know, I've got this set up to evaluate itself every 2,000 iterations. As you can hear, my laptop is going. Let's pop back over to Jupyter Notebook. Oh, there we go. So this one has an average precision of 23.7, and this one, my other one, is not even past 1 yet. So training from scratch is not going as well as transfer learning. Exercise. We have kick sits again. Come on, let's hit the deck. Might go a little bit faster this time. So come through, slide your foot through. That's it. Keep it up. Well done, let's keep moving. That's it, really getting a sweat up now. Rest. Especially wearing this hoodie. You know, usually I do these in the morning, but I actually did some concreting today. So, with my little brother, my little brothers, did some physical labor and I found out how weak my hands are. Have a look at that. See, that's a bruise there. I got two concrete pillars and jammed my finger in there. But you know what? I actually enjoyed that. Not the pain, that sucked a little bit, but we are back to mountain climbers. But getting outside and using my hands. You know, they've gotten weak from being inside too much using computer. Now here we're swapping. Let's go, left and right. Right, left. Right, left. That's it, swap. Keep it up. Let's go, we're doing Rest-a-Rona. Our models are training. Our models are moving. Our bodies are moving. And you know, coming back to that deadline, sometimes you have to go against the opinion of experts. I mean, imagine how many business deals Trump has been in where experts are saying one thing and he's had to go, "Nope, we're gonna have to do this." Now, I'm not saying that everything will be fixed by April 15th. But I think it's good to put in the minds of people, go, "Oh, I have a date to work towards." Let's go lunges. We'll go backwards this time. Boom. Forward. Backwards. Forward. Backwards. That's it. We'll go right. Left. I need to get the opposite arm forward. Keep moving. How many times have you had something where you had a deadline and you thought you couldn't make it, but then miraculously— I believe it's Parkinson's Law or something like that— miraculously you, you come to it and you— everything sort of falls into place. Look at this project I'm working on, my Airbnb project. It's day 32 out of 42. I think it's 33 actually, so I need to fix this up. We're up to week 5. That's what you see running over here. Oh, I believe it might be bodyweight squats. Exercise. Um, squat here. And sometimes you'll be working on projects that are just open-ended and they just get too big, too long, and it just gets filled with too much stuff. So, the fact that I set this up as a 6-week project, this means I can't say yes to everything. Keep moving, by the way. We want to keep doing these squats. No sitting around just watching these videos in bed. Rest. Wonderful. And now, for the surprise. Oh, one last check of the model. Total loss is still going down. Oh, we're nearly at 2. Nearly at 0.5. We're doing 2 rounds today. Remember how I said it's Friday and you know what that means? We're going for 20 minutes today. Usually we go for 10 minutes over the past 10 days, but we're mixing it up. We're going back to basics, but then adding in a little bit of sugar and spice. Exercise. What are we back to? We're back to the start. Push-ups. Let's go fast again this time. How many you gonna get? 10. Yeah! 15. 20. Rest. That was like 25 or something. Really getting the sweats up now. That feels good. But yeah, I was outside today, surprise surprise, moving around concrete wheelbarrows full of concrete. They were heavy as. You sort of get there and you got these, got this like metal grate where all the concrete goes and it's like held up by these plastic lids. And you get there and you're pushing the concrete, you sort of, and you push it forward Whole thing nearly takes you over. We got back to kick sits. Let's go nice and slow this round. We go fast, slow, we'll alternate. That's it, just focus on the movement. Kick through, check your machine learning model, beautiful. And then we check again, not much progress. Come back through it, wonderful. Keep it up. Push through. Yes. Now remember, we're not trying to really, really overexert ourselves. So if at any point this is too much, take a breather, chill out, extend your rest from 30 seconds to a minute or something like that. Catch your breath. You know, I know this isn't going to change very much, but there's something in me that's just like Better check that. Oh, it's gone up 100 iterations. Better do something else. Oh, it's gone up 100 iterations. Exercise. Mountain climbers. Here we go. Up, back. We're going nice and fast this time. Nice and fast. Keep it up. That's it. Technique's going out the window. Yes! Woo! Getting carpet burn on the soles of my feet. That's some good movement. That's some real good movement. Under here, under here is just a layer of sweat. That's what we want. We want to get that sweat because that's when it starts to feel good. Okay. Alright. We should hit an evaluation epoch soon. Nearly at 15,000 on GCP. Next exercise. Lunges, baby. Let's go. We're going forward again. 20 minutes. Model moving, body moving. Simple. What do you do while your machine learning models are training? Leave a comment below. That way we can collectively help each other while the epochs are running. We can find ways to occupy our time. What are you doing right now? I heard, you know, I heard as well. I see, I try to avoid the news as much as possible, but you get, you end up, you end up hearing things inevitably. The entirety of India shut down. Oh, someone's here and the guard dogs are doing their job. But that's, that's a lot of people. 1.4 billion or 1.3 billion completely locked down. Bodyweight squats, you know the drill. Let's go, nice and fast, prison style. Hands behind your head, down, up, up, up. Let's go, 30 seconds on the clock, probably a little bit less now. Keep moving, this is a surprise attack. We're in uncharted waters. We just did a round of uncharted waters. Here we go. We've done— we've actually been through everything 3 sets. Look at that. And by the time this next one's over, we should be up to another evaluation loop. Oh no, maybe not. I've only set it every 5,000, I think, or maybe No, every 2,000, that's great. What are we back to? Exercise. Push-ups, we got nice and slow this time. Down, hold for 2, 1, 2, up, down for 2, 1, 2, up, hold, down for 2, 1, 2, up, hold, down for 2, 1, 2, up, hold. 1, 2, down, hold. Yes! Up, jump forward. Look at that, look at that! Officially in the last loop. Oh, did you see that? Check that out, dark mode. There's little things in life, dark mode has just automatically activated. See, Friday, 6:02 PM. You know, I told you it's Friday and you know what that means. Let's go. Kick sits. Boom. Nice and fast. Keep it up. Shoot through. If your form's going to too much shit, slow down. Like mine, it's going to shit. So I'm going to slow down, come back, kick through. That's it. I'm not trying to buckle myself, just trying to move. Wonderful. B-E-A-utiful. You know, I've got a rule as well. I try to every day before I eat. Someone, actually, a family friend called me up and asked, "How do I lose weight?" I got a rule. I try every day before I eat at all, I do some sort of movement. Whatever that may be, whether it's a session like this, I've already eaten today, or some kind of, maybe a long walk. Exercise. Let's go, mountain climbers. Boom, up. Nice and slow this set. Swap. Right, left. Right, left. That's it, keep it up. I'm watching you. Come on, push it through. Wonder how my model's doing. Are we up to the evaluation loop yet? Let's check it out. That's what we have to look forward to while we're doing our Reps for Rhonda. This is a really important point. There we go. See that inference happening? So what I've done is I've got a whole dataset of 35,000 images to replicate Airbnb's amenity detection. They— of course, I don't have access to their public images, but I'm using 35,000 Open Images, but I'm doing experiments, these experiments here, on a 10% subset. Of that dataset. Exercise. So now we are up to lunges. Let's do it. Come through. The inference wasn't done just yet, so we'll check the results, see how much it improved. Keep it up. That's it. Nice. Let's go, lunges. Come on, mix it up this time. Come on, back. And now forward. And now, back. I'm even confusing myself here. Where do my arms go? Alrighty, there we go. We got some average precision metrics. Come and look at that, 3.6. So, we wait for Weights and Biases. If you're not using Weights and Biases to track your— it's like tracking your workouts. One session you might do a certain amount of weight and it felt great, So you need to track that so the next one you can work on that. Look at that. From, in the last 2,000 iterations. Exercise. Look at that line. Look at that spike. Oh, we're back on, we're working. But the spike, we just went up average precision threefold. And our loss curves are both going down. Good. This will probably run for another few more hours. I mean, we could keep moving all night if you want to. Keep dancing. Let's go, last set, best set. Rest. Look at that. Come here. We're going to wait for that timer to go out. This is what we've done. This is the Tabata app on the App Store. I've had a lot of people asking that. It's just T-A-B-A-T-A. From the App Store. It's fairly— it does what it needs to do. If I was going to build a time wrap, it'd probably have a few more usability fixes, but that does what it needs to do. It doesn't let perfection get in the way of progress. So where did we finish up? Look at that, victory. Is it going to tell us what we did? Done. Great workout. You spent 20 minutes 7 seconds exercising. Look at that. You should be proud of yourself if you've been moving. Now we had a little bit of modeling and a little bit of moving. How was that for day 11 Reps for Rona? Maybe this is a series going forward. Every time I train a machine learning model, we monitor the training progress whilst doing some sort of movement session. And so what did we do? We did push-ups, kick sits, mountain climbers, lunges, Bodyweight squats, 4 times through, 30 seconds on, 30 seconds off. One time we'll do it fast, and another time we'll do it slow. So thank you all for tuning in. Stay tuned for an update video when I figure out which way I'm going to go. Am I going to train a model from scratch, or am I going to, to use transfer learning? I haven't quite figured that out yet. We're at, we're at the the tail end of week 5. I would have liked to have had modelling finished by now, but the good news is that even if the project doesn't go through, we can still keep moving. So wipe that sweat off your nose, hopefully it's there. Oh, actually, don't do that. Don't touch your face. Stay indoors, keep moving, stay alert, and if you're happy and you know it, wash your hands. See you tomorrow.
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


