class_docstr: Network that predicts warps as a translation field.
  
  References:
    https://en.wikipedia.org/wiki/Vector_potential
    https://en.wikipedia.org/wiki/Helmholtz_decomposition
  
  Attributes:
    points_encoder: the positional encoder for the points.
    metadata_encoder: an encoder for metadata.
    alpha: the alpha for the positional encoding.
    skips: the index of the layers with skip connections.
    depth: the depth of the network excluding the output layer.
    hidden_channels: the width of the network hidden layers.
    activation: the activation for each layer.
    metadata_encoded: whether the metadata parameter is pre-encoded or not.
    hidden_initializer: the initializer for the hidden layers.
    output_initializer: the initializer for the last output layer.
class_docstr_tok: ["Network","that","predicts","warps","as","a","translation","field",".","References",":","https",":","\/\/en.wikipedia.org\/wiki\/Vector_potential","https",":","\/\/en.wikipedia.org\/wiki\/Helmholtz_decomposition","Attributes",":","points_encoder",":","the","positional","encoder","for","the","points",".","metadata_encoder",":","an","encoder","for","metadata",".","alpha",":","the","alpha","for","the","positional","encoding",".","skips",":","the","index","of","the","layers","with","skip","connections",".","depth",":","the","depth","of","the","network","excluding","the","output","layer",".","hidden_channels",":","the","width","of","the","network","hidden","layers",".","activation",":","the","activation","for","each","layer",".","metadata_encoded",":","whether","the","metadata","parameter","is","pre-encoded","or","not",".","hidden_initializer",":","the","initializer","for","the","hidden","layers",".","output_initializer",":","the","initializer","for","the","last","output","layer","."]
code: def setup(self):
      self.points_encoder = modules.AnnealedSinusoidalEncoder(
          num_freqs=self.num_freqs,
          min_freq_log2=self.min_freq_log2,
          max_freq_log2=self.max_freq_log2,
          use_identity=self.use_identity_map,
      )
  
      if self.metadata_encoder_type == "glo":
          self.metadata_encoder = glo.GloEncoder(
              num_embeddings=self.num_embeddings,
              features=self.num_embedding_features,
          )
      elif self.metadata_encoder_type == "time":
          self.metadata_encoder = modules.TimeEncoder(
              num_freqs=self.metadata_encoder_num_freqs,
              features=self.num_embedding_features,
          )
      elif self.metadata_encoder_type == "blend":
          self.glo_encoder = glo.GloEncoder(
              num_embeddings=self.num_embeddings,
              features=self.num_embedding_features,
          )
          self.time_encoder = modules.TimeEncoder(
              num_freqs=self.metadata_encoder_num_freqs,
              features=self.num_embedding_features,
          )
      else:
          raise ValueError(
              f"Unknown metadata encoder type {self.metadata_encoder_type}"
          )
  
      # Note that this must be done this way instead of using mutable list
      # operations.
      # See https://github.com/google/flax/issues/524.
      # pylint: disable=g-complex-comprehension
      output_dims = 3
      self.mlp = modules.MLP(
          width=self.hidden_channels,
          depth=self.depth,
          skips=self.skips,
          hidden_init=self.hidden_init,
          output_init=self.output_init,
          output_channels=output_dims,
      )
  
imports: from typing import Any, Iterable, Optional, Dict
  from flax import linen
  import jax
  import jax.numpy
  from nerfies import glo
  from nerfies import model_utils
  from nerfies import modules
  from nerfies import rigid_body
  from nerfies import types
label_desc: Use image node_id 1 for calling the TranslationField obj's underlying member method code with example usage: obj.setup() without return types