class_docstr: Gaussian random features for encoding time steps.
class_docstr_tok: ["Gaussian","random","features","for","encoding","time","steps","."]
code: def __init__(self, embed_dim, scale=16, complex_valued=False):
      super().__init__()
      self.complex_valued = complex_valued
      if not complex_valued:
          # If the output is real-valued, we concatenate sin+cos
          #  of the features to avoid ambiguities.
          # Therefore, in this case the effective embed_dim is
          # cut in half. For the complex-valued case,
          # we use complex numbers which each represent sin+cos
          # directly, so the ambiguity is avoided directly,
          # and this halving is not necessary.
          embed_dim = embed_dim // 2
      # Randomly sample weights during initialization. These weights are fixed
      # during optimization and are not trainable.
      self.W = nn.Parameter(
          torch.randn(embed_dim) * scale, requires_grad=False
      )
  
imports: import functools
  from functools import partial
  import numpy
  import torch
  from torch import Tensor, nn
  from torch.nn.modules.batchnorm import _BatchNorm
label_desc: Use image node_id 1 to create a new GaussianFourierProjection object from inherited base classes: nn with example: obj = GaussianFourierProjection(embed_dim, scale, complex_valued)