Also does this half the weights of the corresponding fc layers only or all the model's layers.. i believe model will have a lot more layers than fc_layers
Embarrassingly enough, I was stuck on this for a bit too until I looked about 10 lines up from there, where another var called
model is declared within the scope of the
model = Sequential([
for l1,l2 in zip(model.layers, fc_layers): l1.set_weights(proc_wgts(l2))
model.compile(optimizer=opt, loss='categorical_crossentropy', metrics=['accuracy'])
It is confusing because a different variable called
model is previously defined at the notebook level and holds the whole finetuned VGG model. Anyway, wanted to respond for completeness' sake, but hopefully this will save someone a bit of time too.