TensorFlow
liuzh(少昊)
机器学习工程师,python研发工程师
展开
-
TensorFlow 多标签转化为one-hot
import tensorflow as tf def main(): NUM_CLASSES = 2 # 2分类 labels = [0, 1, 1, 0, 1, 0, 1, 0] # sample label batch_size = tf.size(labels) # get size of labels : 8 labels = tf.expand_...原创 2019-06-14 11:21:13 · 1481 阅读 · 0 评论 -
批量读取数据next_batch()简单实现
def next_batch(train_data, train_target, batch_size): index = [ i for i in range(0,len(train_target)) ] np.random.shuffle(index); batch_data = []; batch_target = []; for i...转载 2019-06-19 14:45:28 · 1650 阅读 · 0 评论