def base_partition_function(self): "Computes the partition function of the base rate RBM" part_vis = gp.prod(1 + gp.exp(self.base_bias_vis)) part_hid = 2**self.rbm.n_hid return part_vis * part_hid
def base_p_vis(self, vis): "Probability of visible units in base rate RBM" punit = (gp.exp(gp.dot(self.base_bias_vis, vis)) / (1 + gp.exp(self.base_bias_vis))) return gp.prod(punit, axis=1)