class_docstr: Runs one step of Uncalibrated Langevin discretized diffusion.
  
  The class generates a Langevin proposal using `_euler_method` function and
  also computes helper `UncalibratedLangevinKernelResults` for the next
  iteration.
  
  Warning: this kernel will not result in a chain which converges to the
  `target_log_prob`. To get a convergent MCMC, use
  `MetropolisAdjustedLangevinAlgorithm(...)` or
  `MetropolisHastings(UncalibratedLangevin(...))`.
  
  For more details on `UncalibratedLangevin`, see
  `MetropolisAdjustedLangevinAlgorithm`.
class_docstr_tok: ["Runs","one","step","of","Uncalibrated","Langevin","discretized","diffusion",".","The","class","generates","a","Langevin","proposal","using","`","_euler_method","`","function","and","also","computes","helper","`","UncalibratedLangevinKernelResults","`","for","the","next","iteration",".","Warning",":","this","kernel","will","not","result","in","a","chain","which","converges","to","the","`","target_log_prob","`",".","To","get","a","convergent","MCMC",",","use","`","MetropolisAdjustedLangevinAlgorithm","(","...",")","`","or","`","MetropolisHastings","(","UncalibratedLangevin","(","...",")",")","`",".","For","more","details","on","`","UncalibratedLangevin","`",",","see","`","MetropolisAdjustedLangevinAlgorithm","`","."]
docstr: Initializes Langevin diffusion transition kernel.
  
  Args:
    target_log_prob_fn: Python callable which takes an argument like
      `current_state` (or `*current_state` if it's a list) and returns its
      (possibly unnormalized) log-density under the target distribution.
    step_size: `Tensor` or Python `list` of `Tensor`s representing the step
      size for the leapfrog integrator. Must broadcast with the shape of
      `current_state`. Larger step sizes lead to faster progress, but
      too-large step sizes make rejection exponentially more likely. When
      possible, it's often helpful to match per-variable step sizes to the
      standard deviations of the target distribution in each variable.
    volatility_fn: Python callable which takes an argument like
      `current_state` (or `*current_state` if it's a list) and returns
      volatility value at `current_state`. Should return a `Tensor` or Python
      `list` of `Tensor`s that must broadcast with the shape of
      `current_state` Defaults to the identity function.
    parallel_iterations: the number of coordinates for which the gradients of
      the volatility matrix `volatility_fn` can be computed in parallel.
    compute_acceptance: Python 'bool' indicating whether to compute the
      Metropolis log-acceptance ratio used to construct
      `MetropolisAdjustedLangevinAlgorithm` kernel.
    experimental_shard_axis_names: A structure of string names indicating how
      members of the state are sharded.
    name: Python `str` name prefixed to Ops created by this function.
      Default value: `None` (i.e., 'mala_kernel').
  
  Returns:
    next_state: Tensor or Python list of `Tensor`s representing the state(s)
      of the Markov chain(s) at each result step. Has same shape as
      `current_state`.
    kernel_results: `collections.namedtuple` of internal calculations used to
      advance the chain.
  
  Raises:
    ValueError: if there isn't one `step_size` or a list with same length as
      `current_state`.
    TypeError: if `volatility_fn` is not callable.
docstr_tok: ["Initializes","Langevin","diffusion","transition","kernel",".","Args",":","target_log_prob_fn",":","Python","callable","which","takes","an","argument","like","`","current_state","`","(","or","`","*","current_state","`","if","it","'s","a","list",")","and","returns","its","(","possibly","unnormalized",")","log-density","under","the","target","distribution",".","step_size",":","`","Tensor","`","or","Python","`","list","`","of","`","Tensor","`","s","representing","the","step","size","for","the","leapfrog","integrator",".","Must","broadcast","with","the","shape","of","`","current_state","`",".","Larger","step","sizes","lead","to","faster","progress",",","but","too-large","step","sizes","make","rejection","exponentially","more","likely",".","When","possible",",","it","'s","often","helpful","to","match","per-variable","step","sizes","to","the","standard","deviations","of","the","target","distribution","in","each","variable",".","volatility_fn",":","Python","callable","which","takes","an","argument","like","`","current_state","`","(","or","`","*","current_state","`","if","it","'s","a","list",")","and","returns","volatility","value","at","`","current_state","`",".","Should","return","a","`","Tensor","`","or","Python","`","list","`","of","`","Tensor","`","s","that","must","broadcast","with","the","shape","of","`","current_state","`","Defaults","to","the","identity","function",".","parallel_iterations",":","the","number","of","coordinates","for","which","the","gradients","of","the","volatility","matrix","`","volatility_fn","`","can","be","computed","in","parallel",".","compute_acceptance",":","Python","'bool","'","indicating","whether","to","compute","the","Metropolis","log-acceptance","ratio","used","to","construct","`","MetropolisAdjustedLangevinAlgorithm","`","kernel",".","experimental_shard_axis_names",":","A","structure","of","string","names","indicating","how","members","of","the","state","are","sharded",".","name",":","Python","`","str","`","name","prefixed","to","Ops","created","by","this","function",".","Default","value",":","`","None","`","(","i.e.",",","'mala_kernel","'",")",".","Returns",":","next_state",":","Tensor","or","Python","list","of","`","Tensor","`","s","representing","the","state","(","s",")","of","the","Markov","chain","(","s",")","at","each","result","step",".","Has","same","shape","as","`","current_state","`",".","kernel_results",":","`","collections.namedtuple","`","of","internal","calculations","used","to","advance","the","chain",".","Raises",":","ValueError",":","if","there","is","n't","one","`","step_size","`","or","a","list","with","same","length","as","`","current_state","`",".","TypeError",":","if","`","volatility_fn","`","is","not","callable","."]
code: def __init__(
      self,
      target_log_prob_fn,
      step_size,
      volatility_fn=None,
      parallel_iterations=10,
      compute_acceptance=True,
      experimental_shard_axis_names=None,
      name=None,
  ):
      """Initializes Langevin diffusion transition kernel.
  
      Args:
        target_log_prob_fn: Python callable which takes an argument like
          `current_state` (or `*current_state` if it's a list) and returns its
          (possibly unnormalized) log-density under the target distribution.
        step_size: `Tensor` or Python `list` of `Tensor`s representing the step
          size for the leapfrog integrator. Must broadcast with the shape of
          `current_state`. Larger step sizes lead to faster progress, but
          too-large step sizes make rejection exponentially more likely. When
          possible, it's often helpful to match per-variable step sizes to the
          standard deviations of the target distribution in each variable.
        volatility_fn: Python callable which takes an argument like
          `current_state` (or `*current_state` if it's a list) and returns
          volatility value at `current_state`. Should return a `Tensor` or Python
          `list` of `Tensor`s that must broadcast with the shape of
          `current_state` Defaults to the identity function.
        parallel_iterations: the number of coordinates for which the gradients of
          the volatility matrix `volatility_fn` can be computed in parallel.
        compute_acceptance: Python 'bool' indicating whether to compute the
          Metropolis log-acceptance ratio used to construct
          `MetropolisAdjustedLangevinAlgorithm` kernel.
        experimental_shard_axis_names: A structure of string names indicating how
          members of the state are sharded.
        name: Python `str` name prefixed to Ops created by this function.
          Default value: `None` (i.e., 'mala_kernel').
  
      Returns:
        next_state: Tensor or Python list of `Tensor`s representing the state(s)
          of the Markov chain(s) at each result step. Has same shape as
          `current_state`.
        kernel_results: `collections.namedtuple` of internal calculations used to
          advance the chain.
  
      Raises:
        ValueError: if there isn't one `step_size` or a list with same length as
          `current_state`.
        TypeError: if `volatility_fn` is not callable.
      """
      # Default value of `volatility_fn` is the identity function.
      if volatility_fn is None:
          volatility_fn = lambda *args: 1.0
      if not callable(volatility_fn):
          raise TypeError(
              "`volatility_fn` must be callable (saw: {})".format(
                  type(volatility_fn)
              )
          )
      self._parameters = dict(
          target_log_prob_fn=target_log_prob_fn,
          step_size=step_size,
          volatility_fn=volatility_fn,
          compute_acceptance=tf.convert_to_tensor(compute_acceptance),
          parallel_iterations=parallel_iterations,
          experimental_shard_axis_names=experimental_shard_axis_names,
          name=name,
      )
  
imports: import collections
  import tensorflow.compat.v2
  from tensorflow_probability.python.internal import distribute_lib
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.internal import samplers
  from tensorflow_probability.python.math.diag_jacobian import diag_jacobian
  from tensorflow_probability.python.mcmc import kernel
  from tensorflow_probability.python.mcmc import metropolis_hastings
  from tensorflow_probability.python.mcmc.internal import util
label_desc: Use image node_id 1 to create a new UncalibratedLangevin object from inherited base classes: kernel_base with example: obj = UncalibratedLangevin(target_log_prob_fn, step_size, volatility_fn, parallel_iterations, compute_acceptance, experimental_shard_axis_names, name)