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: Init function.
  
  Args:
    encoder_decoder_mlp_sizes: The layer sizes of the encoder and the decoder
      architectures of the model.
    param_generator_mlp_sizes: The layer sizes of the parameter generator
      architecture.
    context_mlp_sizes: The layer sizes of the context oracle.
    embed_dim: The dimension of the embedding vectors.
    latent_dim: The latent dimension of the diffusion model.
    context_dim: The dimension of the context vectors.
    num_contexts: How many different domains the model should generate. If
      greater than 0, makes the model generate embeddings.
    weight_decay: L2 weight decay to add to the parameters of the model.
      Defaults to L2.
docstr_tok: ["Init","function",".","Args",":","encoder_decoder_mlp_sizes",":","The","layer","sizes","of","the","encoder","and","the","decoder","architectures","of","the","model",".","param_generator_mlp_sizes",":","The","layer","sizes","of","the","parameter","generator","architecture",".","context_mlp_sizes",":","The","layer","sizes","of","the","context","oracle",".","embed_dim",":","The","dimension","of","the","embedding","vectors",".","latent_dim",":","The","latent","dimension","of","the","diffusion","model",".","context_dim",":","The","dimension","of","the","context","vectors",".","num_contexts",":","How","many","different","domains","the","model","should","generate",".","If","greater","than","0",",","makes","the","model","generate","embeddings",".","weight_decay",":","L2","weight","decay","to","add","to","the","parameters","of","the","model",".","Defaults","to","L2","."]
code: def __init__(
      self,
      encoder_decoder_mlp_sizes: Sequence[int],
      param_generator_mlp_sizes: Sequence[int],
      context_mlp_sizes: Sequence[int],
      embed_dim: int,
      latent_dim: int,
      context_dim: int,
      num_contexts: int = 0,
      weight_decay: float = 1e-4,
  ):
      """Init function.
  
      Args:
        encoder_decoder_mlp_sizes: The layer sizes of the encoder and the decoder
          architectures of the model.
        param_generator_mlp_sizes: The layer sizes of the parameter generator
          architecture.
        context_mlp_sizes: The layer sizes of the context oracle.
        embed_dim: The dimension of the embedding vectors.
        latent_dim: The latent dimension of the diffusion model.
        context_dim: The dimension of the context vectors.
        num_contexts: How many different domains the model should generate. If
          greater than 0, makes the model generate embeddings.
        weight_decay: L2 weight decay to add to the parameters of the model.
          Defaults to L2.
      """
      super().__init__()
  
      self.encoder = MLPEmbeddingMapper(
          latent_dim, encoder_decoder_mlp_sizes, weight_decay
      )
  
      self.context = MLPEmbeddingMapper(
          context_dim, context_mlp_sizes, weight_decay
      )
  
      decoder_mlp_sizes = encoder_decoder_mlp_sizes[::-1]
      self.num_contexts = num_contexts
      self.generation = num_contexts > 0
      self.param_dims = (
          [latent_dim] + list(decoder_mlp_sizes) + [embed_dim]
      )
      self.param_generator_list = []
      for i in range(len(self.param_dims) - 1):
          # The generated parameters are param_dims[i] * param_dims[i+1] for the
          # weight matrix, plus param_dims[i+1] for the bias.
          param_generator_output_dim = (
              self.param_dims[i] + 1
          ) * self.param_dims[i + 1]
  
          # TODO(smyrnisg): Make this a single Dense layer.
          param_generator = MLPEmbeddingMapper(
              param_generator_output_dim,
              param_generator_mlp_sizes,
              weight_decay,
          )
          self.param_generator_list.append(param_generator)
  
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 ParameterGenerationEmbeddingMapper object from inherited base classes: EmbeddingMapper with example: obj = ParameterGenerationEmbeddingMapper(encoder_decoder_mlp_sizes, param_generator_mlp_sizes, context_mlp_sizes, embed_dim, latent_dim, context_dim, num_contexts, weight_decay)