Currently, output_layers_id is an Optional argument with a default value often chosen as [-2] to enforce the feature extractor to project onto the penultimate layer. However, often, the layer identified as -2 can be something else. For instance, -1 can be a softmax layer and -2 the linear layer, in which case layer[-2] is not the penultimate layer.
Proposed solution: make this argument non optional with a link to a doc tutorial showing how to properly fill this argument as an error message thrown by
assert output_layers_id is not None, "error msg with link"
[Additional suggestion, YP] : In torch, when the model is not a Sequential and the output layer id is an integer, send a warning message recommanding the user to use a string layer id instead.
Currently,
output_layers_id
is an Optional argument with a default value often chosen as [-2] to enforce the feature extractor to project onto the penultimate layer. However, often, the layer identified as -2 can be something else. For instance, -1 can be a softmax layer and -2 the linear layer, in which case layer[-2] is not the penultimate layer.Proposed solution: make this argument non optional with a link to a doc tutorial showing how to properly fill this argument as an error message thrown by
[Additional suggestion, YP] : In torch, when the model is not a Sequential and the output layer id is an integer, send a warning message recommanding the user to use a string layer id instead.