Now that we have trained the model, we need to save and load it. Let's get started:
- We will start by saving the model:
In[31]: model.save('myfirstmodel.h5')\
- Next, we will import the model:
In[32]: from keras.models import load_model
In[33]: newmodel = tf.keras.models.load_model('myfirstmodel.h5')
- Finally, we will predict the imported model:
In[34]: test_predictions = model.predict(normed_test_data).flatten()
With that, you have implemented your first deep learning model!