class_docstr: The multi dimensional Brownian Motion.
class_docstr_tok: ["The","multi","dimensional","Brownian","Motion","."]
docstr: Returns a sample of paths from the process.
  
  Generates samples of paths from the process at the specified time points.
  
  Args:
    times: Rank 1 `Tensor` of increasing positive real values. The times at
      which the path points are to be evaluated.
    num_samples: Positive scalar `int`. The number of paths to draw.
    initial_state: `Tensor` of shape `[dim]`. The initial state of the
      process.
      Default value: None which maps to a zero initial state.
    random_type: Enum value of `RandomType`. The type of (quasi)-random number
      generator to use to generate the paths.
      Default value: None which maps to the standard pseudo-random numbers.
    seed: Python `int`. The random seed to use. If not supplied, no seed is
      set.
    swap_memory: Whether GPU-CPU memory swap is enabled for this op. See
      equivalent flag in `tf.while_loop` documentation for more details.
      Useful when computing a gradient of the op since `tf.while_loop` is used
      to propagate stochastic process in time.
    name: str. The name to give this op. If not supplied, default name of
      `sample_paths` is used.
    **kwargs: parameters, specific to Euler schema: `grid_step` is rank 0 real
      `Tensor` - maximal distance between points in grid in Euler schema. Note
      that Euler sampling is only used if it is not possible to do exact
      sampling because total drift or total covariance are unavailable.
  
  Returns:
   A real `Tensor` of shape [num_samples, k, n] where `k` is the size of the
      `times`, `n` is the dimension of the process.
docstr_tok: ["Returns","a","sample","of","paths","from","the","process",".","Generates","samples","of","paths","from","the","process","at","the","specified","time","points",".","Args",":","times",":","Rank","1","`","Tensor","`","of","increasing","positive","real","values",".","The","times","at","which","the","path","points","are","to","be","evaluated",".","num_samples",":","Positive","scalar","`","int","`",".","The","number","of","paths","to","draw",".","initial_state",":","`","Tensor","`","of","shape","`","[","dim","]","`",".","The","initial","state","of","the","process",".","Default","value",":","None","which","maps","to","a","zero","initial","state",".","random_type",":","Enum","value","of","`","RandomType","`",".","The","type","of","(","quasi",")","-random","number","generator","to","use","to","generate","the","paths",".","Default","value",":","None","which","maps","to","the","standard","pseudo-random","numbers",".","seed",":","Python","`","int","`",".","The","random","seed","to","use",".","If","not","supplied",",","no","seed","is","set",".","swap_memory",":","Whether","GPU-CPU","memory","swap","is","enabled","for","this","op",".","See","equivalent","flag","in","`","tf.while_loop","`","documentation","for","more","details",".","Useful","when","computing","a","gradient","of","the","op","since","`","tf.while_loop","`","is","used","to","propagate","stochastic","process","in","time",".","name",":","str",".","The","name","to","give","this","op",".","If","not","supplied",",","default","name","of","`","sample_paths","`","is","used",".","*","*","kwargs",":","parameters",",","specific","to","Euler","schema",":","`","grid_step","`","is","rank","0","real","`","Tensor","`","-","maximal","distance","between","points","in","grid","in","Euler","schema",".","Note","that","Euler","sampling","is","only","used","if","it","is","not","possible","to","do","exact","sampling","because","total","drift","or","total","covariance","are","unavailable",".","Returns",":","A","real","`","Tensor","`","of","shape","[","num_samples",",","k",",","n","]","where","`","k","`","is","the","size","of","the","`","times","`",",","`","n","`","is","the","dimension","of","the","process","."]
code: def sample_paths(
      self,
      times,
      num_samples=1,
      initial_state=None,
      random_type=None,
      seed=None,
      swap_memory=True,
      name=None,
      **kwargs,
  ):
      """Returns a sample of paths from the process.
  
      Generates samples of paths from the process at the specified time points.
  
      Args:
        times: Rank 1 `Tensor` of increasing positive real values. The times at
          which the path points are to be evaluated.
        num_samples: Positive scalar `int`. The number of paths to draw.
        initial_state: `Tensor` of shape `[dim]`. The initial state of the
          process.
          Default value: None which maps to a zero initial state.
        random_type: Enum value of `RandomType`. The type of (quasi)-random number
          generator to use to generate the paths.
          Default value: None which maps to the standard pseudo-random numbers.
        seed: Python `int`. The random seed to use. If not supplied, no seed is
          set.
        swap_memory: Whether GPU-CPU memory swap is enabled for this op. See
          equivalent flag in `tf.while_loop` documentation for more details.
          Useful when computing a gradient of the op since `tf.while_loop` is used
          to propagate stochastic process in time.
        name: str. The name to give this op. If not supplied, default name of
          `sample_paths` is used.
        **kwargs: parameters, specific to Euler schema: `grid_step` is rank 0 real
          `Tensor` - maximal distance between points in grid in Euler schema. Note
          that Euler sampling is only used if it is not possible to do exact
          sampling because total drift or total covariance are unavailable.
  
      Returns:
       A real `Tensor` of shape [num_samples, k, n] where `k` is the size of the
          `times`, `n` is the dimension of the process.
      """
      if (
          self._total_drift_fn is None
          or self._total_covariance_fn is None
      ):
          return super(BrownianMotion, self).sample_paths(
              times,
              num_samples=num_samples,
              initial_state=initial_state,
              random_type=random_type,
              seed=seed,
              name=name,
              **kwargs,
          )
  
      default_name = self._name + "_sample_path"
      with tf.compat.v1.name_scope(
          name, default_name=default_name, values=[times, initial_state]
      ):
          end_times = tf.convert_to_tensor(times, dtype=self.dtype())
          start_times = tf.concat(
              [tf.zeros([1], dtype=end_times.dtype), end_times[:-1]],
              axis=0,
          )
          paths = self._exact_sampling(
              end_times,
              start_times,
              num_samples,
              initial_state,
              random_type,
              seed,
          )
          if initial_state is not None:
              return paths + initial_state
          return paths
  
file_path: tf-quant-finance/tf_quant_finance/models/legacy/brownian_motion.py
imports: import tensorflow.compat.v2
  from tf_quant_finance.math.random_ops import multivariate_normal
  from tf_quant_finance.models.legacy import brownian_motion_utils
  from tf_quant_finance.models.legacy import ito_process
label_desc: Use image node_id 9 for calling the BrownianMotion obj's underlying member method code with example usage: obj.sample_paths(times, num_samples, initial_state, random_type, seed, swap_memory, name) and returns: super, paths, unknown