def _dropout(values, recurrent_noise, keep_prob):
def dropout(index, value, noise):
random_tensor = keep_prob + noise
binary_tensor = tf.floor(random_tensor)
ret = tf.div(value, keep_prob) * binary_tensor
ret.set_shape(value.get_shape())
return ret
return DropoutGRUCell._enumerated_map_structure(dropout, values, recurrent_noise)
评论列表
文章目录