def tensorflow_categorical(count, seed):
assert count > 0
arr = [1.] + [.0 for _ in range(count-1)]
return tf.random_shuffle(arr, seed)
# Returns a random array [x0, x1, ...xn] where one is 1 and the others
# are 0. Ex: [0, 0, 1, 0].
评论列表
文章目录