code: def _empirical_characteristic_function(samples, ts):
      """
      This function estimates the characteristic function for the wavelet spread of a single node.
  
      Args:
          samples (Tensor): a tensor of samples drawn from a wavelet distribution at different scales.
          ts (Tensor): a tensor containing the "time" points to sample the characteristic function at.
      Returns:
          embedding (Tensor): the node embedding for the GraphWave algorithm.
      """
      # (scales, ns) -> (1, scales, ns)
      samples = samples[tf.newaxis, :, :]
      # (nt,) -> (nt, 1, 1)
      ts = ts[:, tf.newaxis, tf.newaxis]
  
      # (1, scales, ns) * (nt, 1, 1) -> (nt, scales, ns) via broadcasting rules
      t_psi = samples * ts
  
      # (nt, scales, ns) -> (nt, scales)
      mean_cos_t_psi = tf.math.reduce_mean(tf.math.cos(t_psi), axis=2)
  
      # (nt, scales, ns) -> (nt, scales)
      mean_sin_t_psi = tf.math.reduce_mean(tf.math.sin(t_psi), axis=2)
  
      # [(nt, scales), (nt, scales)] -> (2 * nt * scales,)
      embedding = K.flatten(
          tf.concat([mean_cos_t_psi, mean_sin_t_psi], axis=0)
      )
  
      return embedding
  
file_path: stellargraph/stellargraph/mapper/graphwave_generator.py
imports: import tensorflow
  from tensorflow.keras import backend
  import numpy
  from ..core import StellarGraph
  from ..core.validation import require_integer_in_range
  from .base import Generator
  from scipy.sparse.linalg import eigs
  from scipy.sparse import diags
label_desc: Use image node_id 1 for calling a global function with example usage: _empirical_characteristic_function(samples, ts) and returns: embedding