def sample(probs):
# Takes in a vector of probabilities, and returns a random vector of 0s and 1s sampled from the input vector
return tf.floor(probs + tf.random_uniform(tf.shape(probs), 0, 1))
# This function runs the gibbs chain. We will call this function in two places:
# - When we define the training update step
# - When we sample our music segments from the trained RBM
rbm_chords.py 文件源码
python
阅读 23
收藏 0
点赞 0
评论 0
评论列表
文章目录