class_docstr: Restricted  Boltzmann Machine
class_docstr_tok: ["Restricted","Boltzmann","Machine"]
docstr: Calculate contrastive divergence, which is the difference between
  the free energy clamped on the data (v) and the model Free energy (v_k).
  
  Args:
      vv (tf.Tensor, float32): empirical input
  
  Returns:
      obj: contrastive divergence
docstr_tok: ["Calculate","contrastive","divergence",",","which","is","the","difference","between","the","free","energy","clamped","on","the","data","(","v",")","and","the","model","Free","energy","(","v_k",")",".","Args",":","vv","(","tf.Tensor",",","float32",")",":","empirical","input","Returns",":","obj",":","contrastive","divergence"]
code: def losses(self, vv):
      """Calculate contrastive divergence, which is the difference between
      the free energy clamped on the data (v) and the model Free energy (v_k).
  
      Args:
          vv (tf.Tensor, float32): empirical input
  
      Returns:
          obj: contrastive divergence
      """
  
      with tf.compat.v1.variable_scope("losses"):
          obj = self.free_energy(vv) - self.free_energy(self.v_k)
  
      return obj
  
imports: import numpy
  import tensorflow
  import logging
  import os
  from pathlib import Path
label_desc: Use image node_id 11 for calling the RBM obj's underlying member method code with example usage: obj.losses(vv) and returns: obj