tensorflow
闲云野鹤01
沟通邮箱xiaosongcsdn@163.com
展开
-
tensorflow简答实例1
import tensorflow as tfimport numpy as npimport matplotlib.pyplot as plt# 使用numpy产生一百个随机点x_data = np.random.rand(100)# print(x_data)y_data = x_data *0.1 +0.2# plt.plot(x_data,y_data)# plt.sh...原创 2019-10-06 13:30:19 · 81 阅读 · 0 评论 -
tensorflow(非线性回归)
import os# os.environ["TF_CPP_MIN_LOG_LEVEL"]='1' # 这是默认的显示等级,显示所有信息os.environ["TF_CPP_MIN_LOG_LEVEL"]='2' # 只显示 warning 和 Error# os.environ["TF_CPP_MIN_LOG_LEVEL"]='3' # 只显示 Errorimport tensor...原创 2019-10-06 14:09:47 · 96 阅读 · 0 评论 -
一元线性回归(代码)
import tensorflow as tfimport numpy as npimport matplotlib.pyplot as pltx_data = np.linspace(-1, 1, 100) # 生成-1到1之间的100个等差数列点y_data = 7.0 * x_data + 2.9 + np.random.randn(*x_data.shape) * 0.6 ...原创 2019-10-07 13:47:12 · 1221 阅读 · 0 评论 -
多元线性回归(笔记)
import tensorflow as tfimport numpy as npimport matplotlib.pyplot as pltimport pandas as pdfrom sklearn.utils import shufflelogdir = 'E:/python/log' # log存储路径tf.reset_default_graph() # 清除def...原创 2019-10-07 13:50:29 · 195 阅读 · 0 评论 -
TensorFlow 报错:InvalidArgumentError (see above for traceback): tags and values not the same shape: [
这里出错的原因是定义的 loss 采用 sparse_softmax_cross_entropy_with_logitsloss = tf.nn.sparse_softmax_cross_entropy_with_logits(labels=tf.argmax(labels_holder,1), logits=label_predict)查阅 TensorFlow API:https://...原创 2019-10-08 10:39:33 · 1150 阅读 · 1 评论