class_docstr: Grid-to-Grid Model with U-Net skip connections.
class_docstr_tok: ["Grid-to-Grid","Model","with","U-Net","skip","connections","."]
docstr: Initialization.
  
  Args:
    in_grid_res: int, input grid resolution, must be powers of 2.
    out_grid_res: int, output grid resolution, must be powers of 2.
    num_filters: int, number of feature layers at smallest grid resolution.
    codelen: int, length of local latent codes.
    out_features: int, number of output feature channels.
    net_type: str, implicit function network architecture. imnet/deepsdf.
    name: str, name of the layer.
  
  Raises:
    NotImplementedError: if net_type is not imnet or deepsdf.
    ValueError: if in_grid_res or out_grid_res is not powers of 2.
docstr_tok: ["Initialization",".","Args",":","in_grid_res",":","int",",","input","grid","resolution",",","must","be","powers","of","2.","out_grid_res",":","int",",","output","grid","resolution",",","must","be","powers","of","2.","num_filters",":","int",",","number","of","feature","layers","at","smallest","grid","resolution",".","codelen",":","int",",","length","of","local","latent","codes",".","out_features",":","int",",","number","of","output","feature","channels",".","net_type",":","str",",","implicit","function","network","architecture",".","imnet\/deepsdf",".","name",":","str",",","name","of","the","layer",".","Raises",":","NotImplementedError",":","if","net_type","is","not","imnet","or","deepsdf",".","ValueError",":","if","in_grid_res","or","out_grid_res","is","not","powers","of","2","."]
code: def __init__(
      self,
      in_grid_res=32,
      out_grid_res=8,
      num_filters=256,
      codelen=128,
      out_features=1,
      net_type="imnet",
      name="g2g",
  ):
      """Initialization.
  
      Args:
        in_grid_res: int, input grid resolution, must be powers of 2.
        out_grid_res: int, output grid resolution, must be powers of 2.
        num_filters: int, number of feature layers at smallest grid resolution.
        codelen: int, length of local latent codes.
        out_features: int, number of output feature channels.
        net_type: str, implicit function network architecture. imnet/deepsdf.
        name: str, name of the layer.
  
      Raises:
        NotImplementedError: if net_type is not imnet or deepsdf.
        ValueError: if in_grid_res or out_grid_res is not powers of 2.
      """
      super(ModelG2G, self).__init__(name=name)
      if (
          math.log(out_grid_res, 2) % 1 != 0
          or math.log(in_grid_res, 2) % 1 != 0
      ):
          raise ValueError(
              "in_grid_res and out_grid_res must be powers of 2."
          )
      if net_type not in ["imnet", "deepsdf"]:
          raise NotImplementedError
      self.codelen = codelen
      self.out_features = out_features
      self.in_grid_res = in_grid_res
      self.out_grid_res = out_grid_res
      self.num_filters = num_filters
      self.net_type = net_type
  
      self.outgrid = None
  
      self.unet = UNet3D(
          in_grid_res=in_grid_res,
          out_grid_res=out_grid_res,
          num_filters=num_filters,
          out_features=codelen,
      )
      self.lig = lig.LocalImplicitGrid(
          size=(out_grid_res, out_grid_res, out_grid_res),
          in_features=codelen,
          out_features=out_features,
          net_type=net_type,
      )
  
imports: import math
  import tensorflow.compat.v1
  from tensorflow_graphics.projects.local_implicit_grid.core import local_implicit_grid_layer
label_desc: Use image node_id 1 to create a new ModelG2G object from inherited base classes: tf.keras with example: obj = ModelG2G(in_grid_res, out_grid_res, num_filters, codelen, out_features, net_type, name)