def gibbs_sample_h(self, x):
"""
Sample a new h from p(h|x) using current parameters.
:param x: shape (dim_input, 1)
:return: shape (dim_hidden, 1)
"""
h_mean = expit(self.bias_hidden + self.W.dot(x))
return self.bernoulli(h_mean)
评论列表
文章目录