美文网首页
TensorFlow 2.0 补充

TensorFlow 2.0 补充

作者: moonmoon222 | 来源:发表于2020-05-11 19:52 被阅读0次

x = tf.linspace(-5.0,5,11)   # 生成线性均分数据集 tf.Tensor([-5. -4. -3. -2. -1. 0. 1. 2. 3. 4. 5.], shape=(11,), dtype=float32)

train_db = tf.data.Dataset.from_tensor_slices((train_dataset.values,train_labels.values))# 构建 Dataset 对象

train_db = train_db.shuffle(100).batch(32)# 随机打散,批量化

a,b=train_x.take(range(13),axis=1),train_x.take(range(13,39),axis=1)

a:0到13列;b:第13到39列

相关文章

网友评论

      本文标题:TensorFlow 2.0 补充

      本文链接:https://www.haomeiwen.com/subject/upypnhtx.html