Tensorflow keras freeze / unfreeze a specific layer or multiple layers based on layer name. Freezing a layer retains current weights of a layer and does not alter when the model is trained / during model fitting. Simply put the the frozen layers are not trainable. Freezing layer is a technique predominantly used for transfer learning and fine-tuning.These are cases in which we wish to retain layer weights; as this could be an already trained model like resnet , mobilenet,etc. Or we just want to train only certain layers in the current model and not the whole model- we can freeze and unfreeze layers according to our needs and then start the fitting processing. Creating a new tensorflow model using functional api - execute the given code to generate the following model. Generated model is stored in a variable called "model". # viewing the model info # pass "show_trainable=True" # to see whether a layer is trainable model.summary(show_trainable=True) Model: ...
Covering React frameworks like Next.js and Gatsby.js through brief articles with code snippets. Making learning easy for readers and myself.