docstr: Args:
      n_harmonic_functions_xyz: The number of harmonic functions
          used to form the harmonic embedding of 3D point locations.
      n_harmonic_functions_dir: The number of harmonic functions
          used to form the harmonic embedding of the ray directions.
      n_hidden_neurons_xyz: The number of hidden units in the
          fully connected layers of the MLP that accepts the 3D point
          locations and outputs the occupancy field with the intermediate
          features.
      n_hidden_neurons_dir: The number of hidden units in the
          fully connected layers of the MLP that accepts the intermediate
          features and ray directions and outputs the radiance field
          (per-point colors).
      n_layers_xyz: The number of layers of the MLP that outputs the
          occupancy field.
      append_xyz: The list of indices of the skip layers of the occupancy MLP.
      use_multiple_streams: Whether density and color should be calculated on
          separate CUDA streams.
docstr_tok: ["Args",":","n_harmonic_functions_xyz",":","The","number","of","harmonic","functions","used","to","form","the","harmonic","embedding","of","3D","point","locations",".","n_harmonic_functions_dir",":","The","number","of","harmonic","functions","used","to","form","the","harmonic","embedding","of","the","ray","directions",".","n_hidden_neurons_xyz",":","The","number","of","hidden","units","in","the","fully","connected","layers","of","the","MLP","that","accepts","the","3D","point","locations","and","outputs","the","occupancy","field","with","the","intermediate","features",".","n_hidden_neurons_dir",":","The","number","of","hidden","units","in","the","fully","connected","layers","of","the","MLP","that","accepts","the","intermediate","features","and","ray","directions","and","outputs","the","radiance","field","(","per-point","colors",")",".","n_layers_xyz",":","The","number","of","layers","of","the","MLP","that","outputs","the","occupancy","field",".","append_xyz",":","The","list","of","indices","of","the","skip","layers","of","the","occupancy","MLP",".","use_multiple_streams",":","Whether","density","and","color","should","be","calculated","on","separate","CUDA","streams","."]
code: def __init__(
      self,
      n_harmonic_functions_xyz: int = 6,
      n_harmonic_functions_dir: int = 4,
      n_hidden_neurons_xyz: int = 256,
      n_hidden_neurons_dir: int = 128,
      n_layers_xyz: int = 8,
      append_xyz: Tuple[int, ...] = (5,),
      use_multiple_streams: bool = True,
      **kwargs,
  ):
      """
      Args:
          n_harmonic_functions_xyz: The number of harmonic functions
              used to form the harmonic embedding of 3D point locations.
          n_harmonic_functions_dir: The number of harmonic functions
              used to form the harmonic embedding of the ray directions.
          n_hidden_neurons_xyz: The number of hidden units in the
              fully connected layers of the MLP that accepts the 3D point
              locations and outputs the occupancy field with the intermediate
              features.
          n_hidden_neurons_dir: The number of hidden units in the
              fully connected layers of the MLP that accepts the intermediate
              features and ray directions and outputs the radiance field
              (per-point colors).
          n_layers_xyz: The number of layers of the MLP that outputs the
              occupancy field.
          append_xyz: The list of indices of the skip layers of the occupancy MLP.
          use_multiple_streams: Whether density and color should be calculated on
              separate CUDA streams.
      """
      super().__init__()
  
      # The harmonic embedding layer converts input 3D coordinates
      # to a representation that is more suitable for
      # processing with a deep neural network.
      self.harmonic_embedding_xyz = HarmonicEmbedding(
          n_harmonic_functions_xyz
      )
      self.harmonic_embedding_dir = HarmonicEmbedding(
          n_harmonic_functions_dir
      )
      embedding_dim_xyz = n_harmonic_functions_xyz * 2 * 3 + 3
      embedding_dim_dir = n_harmonic_functions_dir * 2 * 3 + 3
  
      self.mlp_xyz = MLPWithInputSkips(
          n_layers_xyz,
          embedding_dim_xyz,
          n_hidden_neurons_xyz,
          embedding_dim_xyz,
          n_hidden_neurons_xyz,
          input_skips=append_xyz,
      )
  
      self.intermediate_linear = torch.nn.Linear(
          n_hidden_neurons_xyz, n_hidden_neurons_xyz
      )
      _xavier_init(self.intermediate_linear)
  
      self.density_layer = torch.nn.Linear(n_hidden_neurons_xyz, 1)
      _xavier_init(self.density_layer)
  
      # Zero the bias of the density layer to avoid
      # a completely transparent initialization.
      self.density_layer.bias.data[
          :
      ] = 0.0  # fixme: Sometimes this is not enough
  
      self.color_layer = torch.nn.Sequential(
          LinearWithRepeat(
              n_hidden_neurons_xyz + embedding_dim_dir,
              n_hidden_neurons_dir,
          ),
          torch.nn.ReLU(True),
          torch.nn.Linear(n_hidden_neurons_dir, 3),
          torch.nn.Sigmoid(),
      )
      self.use_multiple_streams = use_multiple_streams
  
file_path: pytorch3d/projects/nerf/nerf/implicit_function.py
imports: from typing import Tuple
  import torch
  from pytorch3d.common.linear_with_repeat import LinearWithRepeat
  from pytorch3d.renderer import HarmonicEmbedding, ray_bundle_to_ray_points, RayBundle
label_desc: Use image node_id 1 to create a new NeuralRadianceField object from inherited base classes: torch.nn with example: obj = NeuralRadianceField(n_harmonic_functions_xyz, n_harmonic_functions_dir, n_hidden_neurons_xyz, n_hidden_neurons_dir, n_layers_xyz, append_xyz, use_multiple_streams)