class_docstr: Restricted  Boltzmann Machine
class_docstr_tok: ["Restricted","Boltzmann","Machine"]
docstr: Gibbs sampling: Determines an estimate of the model configuration via sampling. In the binary
  RBM we need to impose that unseen movies stay as such, i.e. the sampling phase should not modify
  the elements where v=0.
  
  Args:
      k (scalar, integer): iterator. Number of sampling steps.
      v (tf.Tensor, float32): visible units.
  
  Returns:
      tf.Tensor, tf.Tensor:
      - `h_k`: The sampled value of the hidden unit at step k, float32.
      - `v_k`: The sampled value of the visible unit at step k, float32.
docstr_tok: ["Gibbs","sampling",":","Determines","an","estimate","of","the","model","configuration","via","sampling",".","In","the","binary","RBM","we","need","to","impose","that","unseen","movies","stay","as","such",",","i.e",".","the","sampling","phase","should","not","modify","the","elements","where","v=0",".","Args",":","k","(","scalar",",","integer",")",":","iterator",".","Number","of","sampling","steps",".","v","(","tf.Tensor",",","float32",")",":","visible","units",".","Returns",":","tf.Tensor",",","tf.Tensor",":","-","`","h_k","`",":","The","sampled","value","of","the","hidden","unit","at","step","k",",","float32",".","-","`","v_k","`",":","The","sampled","value","of","the","visible","unit","at","step","k",",","float32","."]
code: def gibbs_sampling(self):
      """Gibbs sampling: Determines an estimate of the model configuration via sampling. In the binary
      RBM we need to impose that unseen movies stay as such, i.e. the sampling phase should not modify
      the elements where v=0.
  
      Args:
          k (scalar, integer): iterator. Number of sampling steps.
          v (tf.Tensor, float32): visible units.
  
      Returns:
          tf.Tensor, tf.Tensor:
          - `h_k`: The sampled value of the hidden unit at step k, float32.
          - `v_k`: The sampled value of the visible unit at step k, float32.
      """
  
      with tf.compat.v1.name_scope("gibbs_sampling"):
          self.v_k = (
              self.v
          )  # initialize the value of the visible units at step k=0 on the data
  
          if self.debug:
              print("CD step", self.k)
  
          for i in range(self.k):  # k_sampling
              _, h_k = self.sample_hidden_units(self.v_k)
              _, self.v_k = self.sample_visible_units(h_k)
  
imports: import numpy
  import tensorflow
  import logging
  import os
  from pathlib import Path
label_desc: Use image node_id 10 for calling the RBM obj's underlying member method code with example usage: obj.gibbs_sampling() without return types