![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Tensorflow使用
tensorflow的使用方法和案例
酸秀才_
算法
展开
-
TensorFlow 数据处理
1. 文本转id 然后id转onehotimport tensorflow as tffrom sklearn.preprocessing import LabelEncodercats=["股票","母婴","电子","母婴","母婴","房产","股票","房产","电子","电商","股票" ]label_encoder = LabelEncoder()label_encoder.fit_transform(cats)ys_index = label_encoder.transform原创 2022-04-10 22:03:24 · 157 阅读 · 0 评论 -
Tensorflow Dataset使用
文章目录前言一、Dataset使用二、TextLineDataset,string_split使用,以及中间变量打印前言tf的版本:2.7.0记录tensorflow的使用方法一、Dataset使用# from_tensor_slices:表示从张量中获取数据。# make_one_shot_iterator():表示只将数据读取一次,然后就抛弃这个数据了。input_data = [1,2,3,5,8]dataset = tf.data.Dataset.from_tensor_slic原创 2022-04-09 21:19:17 · 376 阅读 · 0 评论