class_docstr: The multi dimensional Brownian Motion.
class_docstr_tok: ["The","multi","dimensional","Brownian","Motion","."]
docstr: Returns a sample of paths from the process.
docstr_tok: ["Returns","a","sample","of","paths","from","the","process","."]
code: def _exact_sampling(
      self,
      end_times,
      start_times,
      num_samples,
      initial_state,
      random_type,
      seed,
  ):
      """Returns a sample of paths from the process."""
      non_decreasing = tf.debugging.assert_greater_equal(
          end_times,
          start_times,
          message="Sampling times must be non-decreasing",
      )
      starts_non_negative = tf.debugging.assert_greater_equal(
          start_times,
          tf.zeros_like(start_times),
          message="Sampling times must not be < 0.",
      )
      with tf.compat.v1.control_dependencies(
          [starts_non_negative, non_decreasing]
      ):
          drifts = self._total_drift_fn(start_times, end_times)
          covars = self._total_covariance_fn(start_times, end_times)
          # path_deltas are of shape [num_samples, size(times), dim].
          path_deltas = mvn.multivariate_normal(
              (num_samples,),
              mean=drifts,
              covariance_matrix=covars,
              random_type=random_type,
              seed=seed,
          )
          paths = tf.cumsum(path_deltas, axis=1)
      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 10 for calling the BrownianMotion obj's underlying member method code with example usage: obj._exact_sampling(end_times, start_times, num_samples, initial_state, random_type, seed) and returns: paths