Loading Pre-Trained Models Video Lecture Transcript This transcript was automatically generated, so there may be discrepancies between the video and the text. 13:07:16 Hi! Everybody! Welcome back in this video. We're going to talk about loading pre trained models, using keras. 13:07:22 So let me go ahead and go to our Jupiter notebook. 13:07:30 Here we go. Sorry the zoom was giving me issues. Here we go, so we're gonna talk about how you can load a save neural network model in this video. 13:07:39 So a lot of times in a real-world setting. 13:07:41 You'll you may have done a lot of work to train a model and get it as good as it can get. 13:07:47 Sometimes you know it took me. Took you a long time to do that, or maybe it's you're in the process, and it's taking a long time and so you can't run it. 13:07:56 Non-stop until it's done training. Maybe you have to pause, save the model and then come back to it later so these are all situations in which you would have a model that you saved with Keras that has either some or all of the training done that you'd like to be able to 13:08:09 access, again without retraining from scratch. So you maybe have saved that model. 13:08:15 And now you're ready to load it again. How can you do that? 13:08:17 With low underscore model. So we're going to pretend we're in a situation where we trained a notebook on that Imdb sentiment problem. 13:08:27 So I'm just gonna get the data ready just like it was. 13:08:31 And how can I load the model that I've saved? 13:08:33 So I have a model saved here. I saved under. 13:08:39 Rnn. Underscore saved model. And so what we're gonna do is we're going to load the model using load model. 13:08:47 So first, I'm going to import that import from from Chris. 13:08:56 Dot models will import load, model. 13:09:00 Then to load the model you put load under score model, and then just the name of the file, slash folder! 13:09:07 So for us, that is. 13:09:10 To for us, that is, Rnn. Saved model. 13:09:18 And now, once I have a model, I can just use it to make predictions. 13:09:22 So here's the prediction on the 70 first observation of the training sets very low probability here. 13:09:28 So I'd probably classify that as a negative sentiment. 13:09:32 You can also, for instance, look at the features of the trained model. So if we did get weight. 13:09:38 It would show us the weights of the model. So these are the weights for the different layers. 13:09:45 Okay, so we can even continue and train the model for additional epics, or maybe tune some of the weights using a new data set. 13:09:53 If we'd like all that as possible, now that the model's been loaded. 13:09:57 So sometimes the pre trained models were not trained by you, but by somebody else. 13:10:01 And if they're very important or used frequently, they'll often get their own packages. 13:10:06 So 2 examples from Nlp are word to back. And Bert so here are some, you know, examples of where you can go and look at the documentation for those packages. 13:10:17 So a lot of times, you know, in this world where neural networks are taking off even more and more, there's gonna be models that have really big models that have been trained by some outside entity. 13:10:26 They're providing an open source version for you to use sometimes they'll put them in packages, and so these are 2 of the most popular for Nlp. 13:10:37 Or at least they were, you know, at like less than you know, like a year or 2 ago. 13:10:42 Who knows where it will be now, or by the time you're watching this video. 13:10:46 Okay, so that's it for this video. You now know how to load a model that you've trained and saved in Karis, and I hope you enjoyed it.