@@ -0,0 +1,406 @@
+def freeze_layers(model, layer_names, unfreeze=False):%0A    %22%22%22 Given a model and a list of layer names, it freezes the weights for%0A        those layers. (if %60unfreeze%60 is set to %60True%60, then it makes the%0A        layers trainable instead).%0A%0A        NOTE: You should call model.compile() after running this.%0A    %22%22%22%0A    for layer_name in layer_names:%0A        model.get_layer(layer_name).trainable = unfreeze%0A

Add freeze_layers()