Closed paulnovello closed 1 year ago
For the interface, I have no use of
output_activation: str = None
flatten: bool = False
batch_size: int = 256
Can I remove them? Or should I keep them unused with default values?
For the output type of the predict
method, is it better to output the default torch.Tensor
or output a np.ndarray
which could be more easy to use with methods implemented is Tensorflow?
I seems like these parameters are used:
output_activation
defines the output activation to apply to the output features (in use when you want to gather the output logits or probabilities)flatten
toggles if the output features are flattened or not (e.g. when the output features are those of a pooling layer)batch_size
is used in the predict methodFor the predict
method, it is indeed better to output a np.ndarray
Just a simple check, the output of feature extractor is the output of the given output layer (specified with output_layers_id
) and not the input right.
I am not familiar with the default behavior of keras
.
Yes. Notice that the output of the whole network is also returned self.output_layers.append(model.output)
l.86 of feature_extractor.py
.
Translate KerasFeatureExtractor into TorchFeatureExtractor. It is unnecessary to translate the methods
gradient_pred
,gradient_index
, andgradient_full
for now because they are likely to be deprecated soon.The class should: