The layers of the feature_extraction part of the model should be swappable. Here are the gotchas:
-
We need to sequester the part of the model that produces the architecture, which is usually called the feature_extraction part in the code. This should be easy using composition, holding a delegate ModelBuilder. This will be enough if we are satisfied with the idea that transfer learning is always either a) a continuation or b) done by replacing the Dense layer head. Eventually the delegate could be parameterized. We haven't emphasized that because monkeying around with the architecture and hyperparameters has been low payoff compared to data correctness. Please vet your yaml for this first.
-
An interesting use case of higher difficulty would be instead of GRU(32,...) and GRU(16,...) what if we had three GRU(16) in a row and we wanted to restart transfer learning by freezing the first two and restarting the third one plus the dense head(s) using parameters from the prior step. This is typical in convolutional transfer learning.
-
In this case some sort of notion of what the layers are called and what to freeze has to be included in the yaml specification.
The layers of the feature_extraction part of the model should be swappable. Here are the gotchas:
We need to sequester the part of the model that produces the architecture, which is usually called the feature_extraction part in the code. This should be easy using composition, holding a delegate ModelBuilder. This will be enough if we are satisfied with the idea that transfer learning is always either a) a continuation or b) done by replacing the Dense layer head. Eventually the delegate could be parameterized. We haven't emphasized that because monkeying around with the architecture and hyperparameters has been low payoff compared to data correctness. Please vet your yaml for this first.
An interesting use case of higher difficulty would be instead of GRU(32,...) and GRU(16,...) what if we had three GRU(16) in a row and we wanted to restart transfer learning by freezing the first two and restarting the third one plus the dense head(s) using parameters from the prior step. This is typical in convolutional transfer learning.
In this case some sort of notion of what the layers are called and what to freeze has to be included in the yaml specification.