class_docstr: Class that implements an autoencoder that uses a context dependent decoder.
  
  This class implements an autoencoder architecture that makes use of a set of
  parameter generators, that generate the parameters of the decoder to be used.
  These generators are context dependent - they are provided with context which
  is learned by another part of the model. This class makes use of a separate
  generator for each layer of the decoder.
  
  All separate parts of this architecture are implemented as MLPs. The decoder
  architecture is assumed to be symmetric to the encoder. The parameter
  generators all have the same architecture.
  
  Attributes:
    encoder: The common encoder model mapping from embedding space to latent
      space.
    context: The context oracle that derives the context vector from each of the
      provided embeddings. This means that the model predicts (is an oracle of)
      the context of the input, which correspons to the obfuscation type.
    param_dims: The dimensions of the intermediate vectors of the decoder, to
      which the parameter generators must adhere. This corresponds to the
      architecture of the decoders as MLPs.
    param_generator_list: The list of parameter generators for this model.
class_docstr_tok: ["Class","that","implements","an","autoencoder","that","uses","a","context","dependent","decoder",".","This","class","implements","an","autoencoder","architecture","that","makes","use","of","a","set","of","parameter","generators",",","that","generate","the","parameters","of","the","decoder","to","be","used",".","These","generators","are","context","dependent","-","they","are","provided","with","context","which","is","learned","by","another","part","of","the","model",".","This","class","makes","use","of","a","separate","generator","for","each","layer","of","the","decoder",".","All","separate","parts","of","this","architecture","are","implemented","as","MLPs",".","The","decoder","architecture","is","assumed","to","be","symmetric","to","the","encoder",".","The","parameter","generators","all","have","the","same","architecture",".","Attributes",":","encoder",":","The","common","encoder","model","mapping","from","embedding","space","to","latent","space",".","context",":","The","context","oracle","that","derives","the","context","vector","from","each","of","the","provided","embeddings",".","This","means","that","the","model","predicts","(","is","an","oracle","of",")","the","context","of","the","input",",","which","correspons","to","the","obfuscation","type",".","param_dims",":","The","dimensions","of","the","intermediate","vectors","of","the","decoder",",","to","which","the","parameter","generators","must","adhere",".","This","corresponds","to","the","architecture","of","the","decoders","as","MLPs",".","param_generator_list",":","The","list","of","parameter","generators","for","this","model","."]
docstr: Derive the obfuscation context and apply the generated decoder.
  
  This method returns both the generated embeddings and the learned context,
  in order to optimize the context oracle. The context is trained so as to be
  representative of the obfuscation type of the image, in order to be given as
  input to the parameter generator afterwards, for the latter to give us the
  parameters of the correct decoder.
  
  Args:
    inputs: The input embeddings given to the model.
  
  Returns:
    A tuple containing the generated embeddings and the derived context
      vector.
docstr_tok: ["Derive","the","obfuscation","context","and","apply","the","generated","decoder",".","This","method","returns","both","the","generated","embeddings","and","the","learned","context",",","in","order","to","optimize","the","context","oracle",".","The","context","is","trained","so","as","to","be","representative","of","the","obfuscation","type","of","the","image",",","in","order","to","be","given","as","input","to","the","parameter","generator","afterwards",",","for","the","latter","to","give","us","the","parameters","of","the","correct","decoder",".","Args",":","inputs",":","The","input","embeddings","given","to","the","model",".","Returns",":","A","tuple","containing","the","generated","embeddings","and","the","derived","context","vector","."]
code: def call(
      self, inputs: tf.Tensor
  ) -> Tuple[
      tf.Tensor, tf.Tensor
  ]:  # pytype: disable=signature-mismatch
      """Derive the obfuscation context and apply the generated decoder.
  
      This method returns both the generated embeddings and the learned context,
      in order to optimize the context oracle. The context is trained so as to be
      representative of the obfuscation type of the image, in order to be given as
      input to the parameter generator afterwards, for the latter to give us the
      parameters of the correct decoder.
  
      Args:
        inputs: The input embeddings given to the model.
  
      Returns:
        A tuple containing the generated embeddings and the derived context
          vector.
      """
      latent_vec = self.encoder(inputs)
      batch_size = tf.shape(latent_vec)[0]
      if self.generation:
          context_vec = tf.expand_dims(
              tf.range(self.num_contexts), axis=0
          )
          context_vec = tf.repeat(context_vec, batch_size, axis=0)
          context_vec = tf.reshape(context_vec, [-1])
          context_vec = self.context(context_vec)
          result = tf.expand_dims(latent_vec, axis=1)
          result = tf.repeat(result, self.num_contexts, axis=0)
      else:
          context_vec = self.context(inputs)
          result = tf.expand_dims(
              latent_vec, axis=1
          )  # For proper batch matmul.
      for i in range(len(self.param_generator_list)):
          params = self.param_generator_list[i](context_vec)
          params = tf.reshape(
              params,
              [-1, self.param_dims[i] + 1, self.param_dims[i + 1]],
          )
          result = (
              tf.matmul(result, params[:, :-1, :]) + params[:, -1:, :]
          )
  
      result = result[:, 0, :]  # Remove the extra axis.
      if self.generation:
          result = tf.reshape(
              result, [-1, self.num_contexts, result.shape[-1]]
          )
  
      return result, context_vec
  
imports: import abc
  from typing import Union, Tuple, Sequence, Optional
  import tensorflow
  import tensorflow_hub
label_desc: Use image node_id 2 for calling the ParameterGenerationEmbeddingMapper obj's underlying member method code with example usage: obj.call(inputs) and returns: result,  context_vec