<基础笔记>
神经网络:梯度下降。optimization 优化。Gradient Descent梯度下降(数据处理)
cost function 误差分析函数 cost =(predicted -real)^2=(Wx-y)^2=(W-0)^2
神经网络中不止一个W 梯度线躺平的地方全局最优解,tensorflow可以让(局部最优)使我们去用.
输入端,黑盒,输出端,—–宝宝 黑盒 奶瓶,在加一层 (宝宝特征 宝宝图像代表特征 代表特征电脑自己看懂)迁移学习:输出层拆掉,另一个神经网络:(1、分类,2、预测事务的价值)
Session 会话控制
Session 执行命令 会话控制 某一个图片上的结构的小功能(输出参数)
<程序分析>
eg.矩阵相乘的结果,
1 2 3 4 5 6 7 8 9 10 | import tensorflow as tf matrix1 = tf.constant([[3,3]]) matrix2 = tf.constant([[2], [2]]) product = tf.matmul(matrix1,matrix2) # martrix multiply np.dot(m1,m2) # method1 sess = tf.Session() result =sess.run(product) print(result) sess.close() |
# method2
with tf.Session() as sess:
result2 = sess.run(product)
print(result2)
输出结果
注意
思考模式每run一次执行一次,字母大写Session,有close系统整洁。with为文件打开方式,打开会话控制,起别名sess,两种会话打开的方式。