class_docstr: An annealed sinusoidal encoding.
class_docstr_tok: ["An","annealed","sinusoidal","encoding","."]
code: def __call__(self, x, alpha):
      if alpha is None:
          raise ValueError("alpha must be specified.")
      if self.num_freqs == 0:
          return x
  
      num_channels = x.shape[-1]
  
      base_encoder = SinusoidalEncoder(
          num_freqs=self.num_freqs,
          min_freq_log2=self.min_freq_log2,
          max_freq_log2=self.max_freq_log2,
          scale=self.scale,
          use_identity=self.use_identity,
      )
      features = base_encoder(x)
  
      if self.use_identity:
          identity, features = jnp.split(
              features, (x.shape[-1],), axis=-1
          )
  
      # Apply the window by broadcasting to save on memory.
      features = jnp.reshape(features, (-1, 2, num_channels))
      window = self.cosine_easing_window(
          self.min_freq_log2, self.max_freq_log2, self.num_freqs, alpha
      )
      window = jnp.reshape(window, (-1, 1, 1))
      features = window * features
  
      if self.use_identity:
          return jnp.concatenate(
              [
                  identity,
                  features.flatten(),
              ],
              axis=-1,
          )
      else:
          return features.flatten()
  
imports: import functools
  from typing import Optional, Tuple
  from flax import linen
  import jax
  import jax.numpy
  from nerfies import types
label_desc: Use image node_id 1 for calling the AnnealedSinusoidalEncoder obj's underlying member method code with example usage: obj.__call__(x, alpha) and returns: x, jnp, features