A data scientist uses SAS DLPy to apply transfer learning by loading a pre-trained VGG16 model and fine-tuning only the final fully connected layers. Which method call freezes the convolutional base layers during fine-tuning?
Select an answer to reveal the explanation.
Short Explanation
In DLPy you don't flip a switch on each layer; you tell the optimizer what to leave alone. Give Optimizer freeze_layers_to the name of the last conv or pooling layer and everything up to and including it stays frozen, or hand freeze_layers a list of names. Pass that optimizer to model.fit() and only the fully connected head learns.
Full Explanation
In SAS DLPy, freezing is configured on the Optimizer object that drives training rather than on individual layer objects. The freeze_layers_to parameter takes a layer name and freezes that layer and every layer before it, which is exactly the convolutional base of a pretrained VGG16 when you name its last convolution or pooling layer. The freeze_layers parameter takes an explicit list of layer names whose trainable parameters are frozen, which suits a non-contiguous selection. You pass the configured Optimizer as the optimizer argument to model.fit(), and the frozen weights are held constant while the fully connected layers are updated. model.freeze_weights(layers='all_conv') is wrong because DLPy has no such model method. model.set_weights(frozen=True) is wrong because set_weights loads weight tables and has no frozen flag. The claim that DLPy cannot freeze layers is wrong because the Optimizer parameters above provide exactly that control. An exam caveat is that a per-layer trainable attribute, familiar from Keras, is not how DLPy works. To verify, print the model summary to find the exact layer name, train one epoch, and confirm the frozen layers' weights are unchanged.