code: def plot_rbm_sampled_images(rbm_network, data, training_data):
      n_samples = len(training_data)
      iterations = [0, 0, 1, 10, 100, 1000]
  
      nrows, ncols = (6, 6)
      fig, axes = plt.subplots(nrows, ncols, figsize=(16, 16))
  
      titles = [
          "Raw image",
          "Binarized image",
          "Sample after\n1 iteration",
          "Sample after\n10 iterations",
          "Sample after\n100 iterations",
          "Sample after\n1000 iterations",
      ]
  
      for i, title in enumerate(titles):
          axes[0][i].set_title(title)
  
      for i, row_axes in enumerate(axes):
          image_index = np.random.randint(0, n_samples)
          binary_image = training_data[image_index]
  
          show_image(row_axes[0], data[image_index])
          show_image(row_axes[1], binary_image)
  
          for j in range(2, ncols):
              n_iter = iterations[j]
              sampled_image = rbm_network.gibbs_sampling(
                  binary_image, n_iter
              )
              show_image(row_axes[j], sampled_image)
  
      for ax in itertools.chain(*axes):
          disable_ticks(ax)
  
file_path: neupy/examples/boltzmann_machine/rbm_faces_sampling.py
imports: import itertools
  import numpy
  import matplotlib.pyplot
  from sklearn import datasets
  from sklearn.model_selection import train_test_split
  from skimage.filters import threshold_local
  from neupy import algorithms, utils
  from neupy.utils import asfloat
label_desc: Use image node_id 3 for calling a global function with example usage: plot_rbm_sampled_images(rbm_network, data, training_data) without return types