Používání modelů

Úvod do deep learningu v Pythonu

Dan Becker

Data Scientist and contributor to Keras and TensorFlow libraries

Používání modelů

  • Uložení
  • Opětovné načtení
  • Předpovědi
Úvod do deep learningu v Pythonu

Uložení, načtení a použití modelu

from tensorflow.keras.models import load_model
model.save('model_file.h5')
my_model = load_model('model_file.h5')
predictions = my_model.predict(data_to_predict_with)
probability_true = predictions[:,1]
Úvod do deep learningu v Pythonu

Ověření struktury modelu

my_model.summary()
_____________________________________________________________________________________________
Layer (type)                     Output Shape          Param #     Connected to
=========================================================================================
dense_1 (Dense)                  (None, 100)           1100        dense_input_1[0][0]
_____________________________________________________________________________________________
dense_2 (Dense)                  (None, 100)           10100       dense_1[0][0]
_____________________________________________________________________________________________
dense_3 (Dense)                  (None, 100)           10100       dense_2[0][0]
_____________________________________________________________________________________________
dense_4 (Dense)                  (None, 2)             202         dense_3[0][0]
=========================================================================================
Total params: 21,502
Trainable params: 21,502
Non-trainable params: 0
Úvod do deep learningu v Pythonu

Pojďme si procvičit!

Úvod do deep learningu v Pythonu

Preparing Video For Download...