-
Notifications
You must be signed in to change notification settings - Fork 0
Description
What part of the documentation is this about?
This is a request for a new piece of documentation, likely a new vignette, on how to perform transfer learning with pre-trained Keras Applications.
What is the issue?
There is currently no documentation explaining how to perform transfer learning using models from keras::applications
(e.g., ResNet50
, VGG16
) within a kerasnip
and tidymodels
workflow. This is a very common and powerful deep learning pattern, and its absence from the documentation is a significant gap.
Users are left to figure out on their own how to correctly structure the model specification, freeze the weights of the pre-trained base model, and attach a new trainable classification head on top of it.
Suggested improvement
I propose creating a new vignette (e.g., vignettes/applications.Rmd
) that provides a complete, end-to-end example of transfer learning. This guide should clearly demonstrate how to:
- Define a
kerasnip
layer block that correctly wraps a Keras Application. - Show the critical step of freezing the base model's weights for feature extraction by setting
application_block$trainable <- FALSE
. - Use the Keras Functional API via
create_keras_functional_spec()
to attach a new, trainable head to the frozen base. - Integrate the entire model into a standard
tidymodels
workflow for fitting and evaluation.
Additional context
Providing this documentation would resolve the underlying problem that led to my original feature request for a block_from_application()
helper function. A clear, documented example showing the existing, flexible pattern is a much better and more empowering solution than adding a specialized function to the API.