class_docstr: `Reducer` that displays a progress bar.
  
  Note this is not XLA-compatible (`tf.function(jit_compile=True)`).
  Numpy and JAX substrates are not supported.
  
  Example usage:
  
  ```
  kernel = ...
  current_state = ...
  num_results = ...
  pbar = tfp.experimental.mcmc.ProgressBarReducer(num_results)
  _, final_state, kernel_results = tfp.experimental.mcmc.sample_fold(
      num_steps=num_results,
      current_state=current_state,
      kernel=kernel,
      reducer=pbar,
  )
  ```
class_docstr_tok: ["`","Reducer","`","that","displays","a","progress","bar",".","Note","this","is","not","XLA-compatible","(","`","tf.function","(","jit_compile=True",")","`",")",".","Numpy","and","JAX","substrates","are","not","supported",".","Example","usage",":","``","`","kernel","=","...","current_state","=","...","num_results","=","...","pbar","=","tfp.experimental.mcmc.ProgressBarReducer","(","num_results",")","_",",","final_state",",","kernel_results","=","tfp.experimental.mcmc.sample_fold","(","num_steps=num_results",",","current_state=current_state",",","kernel=kernel",",","reducer=pbar",",",")","``","`"]
docstr: Instantiates a reducer that displays a progress bar.
  
  Args:
    num_results: Integer number of results to expect (as passed to sample
      chain).
    progress_bar_fn: A function that takes an integer `num_results` and
      returns an iterator that advances a progress bar. Defaults to `tqdm`
      progress bars (make sure they are pip installed befure using.)
docstr_tok: ["Instantiates","a","reducer","that","displays","a","progress","bar",".","Args",":","num_results",":","Integer","number","of","results","to","expect","(","as","passed","to","sample","chain",")",".","progress_bar_fn",":","A","function","that","takes","an","integer","`","num_results","`","and","returns","an","iterator","that","advances","a","progress","bar",".","Defaults","to","`","tqdm","`","progress","bars","(","make","sure","they","are","pip","installed","befure","using",".",")"]
code: def __init__(
      self, num_results, progress_bar_fn=make_tqdm_progress_bar_fn()
  ):
      """Instantiates a reducer that displays a progress bar.
  
      Args:
        num_results: Integer number of results to expect (as passed to sample
          chain).
        progress_bar_fn: A function that takes an integer `num_results` and
          returns an iterator that advances a progress bar. Defaults to `tqdm`
          progress bars (make sure they are pip installed befure using.)
      """
      self._parameters = dict(
          num_results=num_results,
          progress_bar_fn=progress_bar_fn,
      )
  
file_path: probability/tensorflow_probability/python/experimental/mcmc/progress_bar_reducer.py
imports: import tensorflow.compat.v2
  from tensorflow_probability.python.experimental.mcmc import reducer
label_desc: Use image node_id 1 to create a new ProgressBarReducer object from inherited base classes: reducer_base with example: obj = ProgressBarReducer(num_results, progress_bar_fn)