Introduction to Keras Transfer Learning (9.1)

preview_player
Показать описание
Transfer learning is a process that loads weights from previously trained neural networks. This video shows you how to train a neural network and transfer its weights to another.

Code for This Video:

Follow Me/Subscribe:

Рекомендации по теме
Комментарии
Автор

Transfer learning? Professor, this course is really HEATon up! Thank you for sharing your time and knowledge with us all :)

Zzznmop
Автор

a very crisp and clear explanation of what other tutorials has been trying to explain over pages (y)

roshneekishore
Автор

Hello Jeff, I am trying to add more data to already trained model, i have a 4 class model, my goal is to add data to the model to learn as I get the data, my model size before training with new data was 90 MB, i tried the same steps as yours but my model size got shrunk to 34 MB and it's not predicting properly. I am thinking my previous weights are some how lost, can you please guide ?
new_model = load_model('my_model2.h5')
model3 = Sequential()
for i in range(7):
layer = new_model.layers[i]
layer.trainable = False
model3.add(layer)
model3.add(Dense(512))

model3.add(Dropout(0.3))
model3.add(Dense((num_labels), activation='softmax'))
model3.layers[-4].name = 'dense_7'
model3.layers[-1].name = 'dense_8'
model3.layers[-2].name = 'dropout_3'
model3.layers[-3].name = 'activation_3'
model3.compile(loss='categorical_crossentropy', optimizer='adam', metrics=['accuracy'])
model3.fit(x_train, y_train, batch_size = batch_size, epochs = 50, verbose = 1)
model3.summary()

deepakec