Skip to content

Docs: Add vignette for transfer learning with Keras Applications  #28

@davidrsch

Description

@davidrsch

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:

  1. Define a kerasnip layer block that correctly wraps a Keras Application.
  2. Show the critical step of freezing the base model's weights for feature extraction by setting application_block$trainable <- FALSE.
  3. Use the Keras Functional API via create_keras_functional_spec() to attach a new, trainable head to the frozen base.
  4. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions