class_docstr: Feature extractor wrapper.
  
  This class wraps a feature extraction model and optionally adds a mapping
  layer on top. The intent of this mapping is to transfer embeddings of clean
  images to obfuscated ones.
  
  The base model used in this architecture is defined using TensorFlow Hub. The
  model_link constructor parameter is one of the available models (see
  https://tfhub.dev/s?module-type=image-feature-vector for a list of available
  models).
  
  Attributes:
    base_model: Base feature extractor, originally trained on clean mappings.
      This model is kept frozen during training.
    encoder: EmbeddingMapper object, mapping the embeddings of the obfuscated
      images to the clean ones.
    base_model_trainable: Whether the base model is trainable or not. The
      default is False (so the base model is frozen).
    bypass_base_model: Optionally bypass the base model when using the call()
      method. This is meant to be used in the case where the input is already
      given in embedding space rather than in pixel space. The default is False.
class_docstr_tok: ["Feature","extractor","wrapper",".","This","class","wraps","a","feature","extraction","model","and","optionally","adds","a","mapping","layer","on","top",".","The","intent","of","this","mapping","is","to","transfer","embeddings","of","clean","images","to","obfuscated","ones",".","The","base","model","used","in","this","architecture","is","defined","using","TensorFlow","Hub",".","The","model_link","constructor","parameter","is","one","of","the","available","models","(","see","https",":","\/\/tfhub.dev\/s","?","module-type=image-feature-vector","for","a","list","of","available","models",")",".","Attributes",":","base_model",":","Base","feature","extractor",",","originally","trained","on","clean","mappings",".","This","model","is","kept","frozen","during","training",".","encoder",":","EmbeddingMapper","object",",","mapping","the","embeddings","of","the","obfuscated","images","to","the","clean","ones",".","base_model_trainable",":","Whether","the","base","model","is","trainable","or","not",".","The","default","is","False","(","so","the","base","model","is","frozen",")",".","bypass_base_model",":","Optionally","bypass","the","base","model","when","using","the","call","(",")","method",".","This","is","meant","to","be","used","in","the","case","where","the","input","is","already","given","in","embedding","space","rather","than","in","pixel","space",".","The","default","is","False","."]
code: def __init__(
      self,
      model_link: str,
      encoder: EmbeddingMapper,
      base_model_trainable: bool = False,
      bypass_base_model: bool = False,
  ):
      super().__init__()
      try:
          self.base_model_trainable = base_model_trainable
          self.base_model = hub.KerasLayer(
              model_link, trainable=self.base_model_trainable
          )
      except RuntimeError as e:
          raise ValueError(
              "Implementation corresponding to model_link not found in"
              "TensorFlow Hub. See https://tfhub.dev/"
              "s?module-type=image-feature-vector for a list of"
              "available models"
          ) from e
  
      self.encoder = encoder
      self.bypass_base_model = bypass_base_model
  
imports: import abc
  from typing import Union, Tuple, Sequence, Optional
  import tensorflow
  import tensorflow_hub
label_desc: Use image node_id 1 to create a new FeatureExtractor object from inherited base classes: tf.keras with example: obj = FeatureExtractor(model_link, encoder, base_model_trainable, bypass_base_model)