class_docstr: Convenience constructor for common MCMC transition kernels.
  
  `KernelBuilder` gives an alternative interface for building MCMC transition
  kernels. It wraps the base `tfp.mcmc` library, offering more convenience at
  the cost of some power and flexibility.
  
  It is designed to work in conjunction with `KernelOutputs` for more
  convenience.
  
  Example usage:
  
  ```
  # Initialize builder with `target_log_prob_fn`.
  builder = KernelBuilder(target_log_prob_fn)
  # Configure initial transition kernel.
  builder = (
    builder
    # Use Hamilton Monte Carlo
    .hmc(num_leapfrog_steps=3)
    # with step size adaptation
    .dual_averaging_adaptation()
    .set_num_adaptation_steps(50)
    # and a transformation
    .transform(my_bijector))
  
  # Do sampling...
  outputs = builder.sample(num_steps, initial_state)
  
  # Start from the previous `KernelBuilder` configuration.
  builder = (
    builder
    # Continue using HMC...
    # Still use `my_bijector` transform
    # But with no step size adaptation:
    .clear_step_adapter()
    # set a static step size
    .set_step_size(outputs.new_step_size))
  
  # More sampling starting from where we left off.
  outputs2 = builder.sample(num_steps, outputs.current_state)
  
  # Etc ...
  
  ```
  
  All methods except `build()` and `sample()` return a modified copy of the
  builder for further method-chaining.  The builder itself is immutable
  (namedtuple) for safe use inside of graphs.
  
  `KernelBuilder` builds kernels with the following parts (in order):
  
  1. A core transition kernel
  2. Optional step size adaptation or replica exchange
  3. Transformating bijector
  4. Thinning
  5. Streaming reductions
  
  The core kernels can be either `HamiltonianMonteCarlo`, `NoUTurnSampler`,
  `PreconditionedHamiltonianMonteCarlo`, `MetropolisAdjustedLangevinAlgorithm`,
  or `RandomWalkMetropolis`.  Support for additional core kernels may be added
  in the future.
  
  Step size adaption is performed by `SimpleStepSizeAdaptation` or
  `DualAveragingStepSizeAdaptation`. Note not all core kernels are currently
  compatible with step size adaptation.
  
  `KernelBuilder` maintains some state between kernel builds which can be reused
  or overriden:
  
   1. Target log prob function
   2. Core kernel class
   3. Step size (initial)
   4. Step size adapter class (optional)
   4a. Number of adaptation steps
   4b. Target acceptance probability
   5. Replica exchange parameters (optional)
   6. `TransformedTransitionKernel` bijector/params (optional)
   7. Thinning: number of steps between results (optional)
   8. Tracing parameters for `TracingReducer` / auto-tracing.
   9. Show progress boolean.
  10. Reductions for `WithReductions`
  
  See instance method documentation for more information.
class_docstr_tok: ["Convenience","constructor","for","common","MCMC","transition","kernels",".","`","KernelBuilder","`","gives","an","alternative","interface","for","building","MCMC","transition","kernels",".","It","wraps","the","base","`","tfp.mcmc","`","library",",","offering","more","convenience","at","the","cost","of","some","power","and","flexibility",".","It","is","designed","to","work","in","conjunction","with","`","KernelOutputs","`","for","more","convenience",".","Example","usage",":","``","`","#","Initialize","builder","with","`","target_log_prob_fn","`",".","builder","=","KernelBuilder","(","target_log_prob_fn",")","#","Configure","initial","transition","kernel",".","builder","=","(","builder","#","Use","Hamilton","Monte","Carlo",".hmc","(","num_leapfrog_steps=3",")","#","with","step","size","adaptation",".dual_averaging_adaptation","(",")",".set_num_adaptation_steps","(","50",")","#","and","a","transformation",".transform","(","my_bijector",")",")","#","Do","sampling","...","outputs","=","builder.sample","(","num_steps",",","initial_state",")","#","Start","from","the","previous","`","KernelBuilder","`","configuration",".","builder","=","(","builder","#","Continue","using","HMC","...","#","Still","use","`","my_bijector","`","transform","#","But","with","no","step","size","adaptation",":",".clear_step_adapter","(",")","#","set","a","static","step","size",".set_step_size","(","outputs.new_step_size",")",")","#","More","sampling","starting","from","where","we","left","off",".","outputs2","=","builder.sample","(","num_steps",",","outputs.current_state",")","#","Etc","...","``","`","All","methods","except","`","build","(",")","`","and","`","sample","(",")","`","return","a","modified","copy","of","the","builder","for","further","method-chaining",".","The","builder","itself","is","immutable","(","namedtuple",")","for","safe","use","inside","of","graphs",".","`","KernelBuilder","`","builds","kernels","with","the","following","parts","(","in","order",")",":","1",".","A","core","transition","kernel","2",".","Optional","step","size","adaptation","or","replica","exchange","3",".","Transformating","bijector","4",".","Thinning","5",".","Streaming","reductions","The","core","kernels","can","be","either","`","HamiltonianMonteCarlo","`",",","`","NoUTurnSampler","`",",","`","PreconditionedHamiltonianMonteCarlo","`",",","`","MetropolisAdjustedLangevinAlgorithm","`",",","or","`","RandomWalkMetropolis","`",".","Support","for","additional","core","kernels","may","be","added","in","the","future",".","Step","size","adaption","is","performed","by","`","SimpleStepSizeAdaptation","`","or","`","DualAveragingStepSizeAdaptation","`",".","Note","not","all","core","kernels","are","currently","compatible","with","step","size","adaptation",".","`","KernelBuilder","`","maintains","some","state","between","kernel","builds","which","can","be","reused","or","overriden",":","1",".","Target","log","prob","function","2",".","Core","kernel","class","3",".","Step","size","(","initial",")","4",".","Step","size","adapter","class","(","optional",")","4a",".","Number","of","adaptation","steps","4b",".","Target","acceptance","probability","5",".","Replica","exchange","parameters","(","optional",")","6",".","`","TransformedTransitionKernel","`","bijector\/params","(","optional",")","7",".","Thinning",":","number","of","steps","between","results","(","optional",")","8",".","Tracing","parameters","for","`","TracingReducer","`","\/","auto-tracing",".","9",".","Show","progress","boolean",".","10",".","Reductions","for","`","WithReductions","`","See","instance","method","documentation","for","more","information","."]
docstr: Use per-core class default target acceptance probability (or not.)
code: def use_default_target_accept_prob(self, on=True):
      """Use per-core class default target acceptance probability (or not.)"""
      return self._replace(default_target_accept_prob_on=on)
  
imports: import collections
  from tensorflow_probability.python.experimental.mcmc import kernel_outputs
  from tensorflow_probability.python.experimental.mcmc import preconditioned_hmc
  from tensorflow_probability.python.experimental.mcmc import progress_bar_reducer
  from tensorflow_probability.python.experimental.mcmc import sample_discarding_kernel
  from tensorflow_probability.python.experimental.mcmc import step
  from tensorflow_probability.python.experimental.mcmc import tracing_reducer
  from tensorflow_probability.python.experimental.mcmc import with_reductions
  from tensorflow_probability.python.mcmc import dual_averaging_step_size_adaptation
  from tensorflow_probability.python.mcmc import hmc
  from tensorflow_probability.python.mcmc import langevin
  from tensorflow_probability.python.mcmc import nuts
  from tensorflow_probability.python.mcmc import random_walk_metropolis
  from tensorflow_probability.python.mcmc import replica_exchange_mc
  from tensorflow_probability.python.mcmc import simple_step_size_adaptation
  from tensorflow_probability.python.mcmc import transformed_kernel
  from tensorflow_probability.python.mcmc.internal import util
label_desc: Use image node_id 16 for calling the KernelBuilder obj's underlying member method code with example usage: obj.use_default_target_accept_prob(on) and returns: self