tensorflow基础语法
来源:互联网 发布:网络流行歌曲2014 编辑:程序博客网 时间:2024/05/22 10:23
上手试试:
import tensorflow as tfinput1 = tf.constant(3.0)input2 = tf.constant(2.0)input3 = tf.constant(5.0)intermed = tf.add(input2, input3)#1.0版本mul改为multiplymul = tf.multiply(input1, intermed)with tf.Session() as sess: result = sess.run([mul, intermed]) print(result)
更多更改:
tf.sub()更改为tf.subtract()tf.mul()更改为tf.multiply()tf.types.float32更改为tf.float32tf.pact()更改为tf.stact()
feed机制:
feed 使用一个 tensor 值临时替换一个操作的输出结果. 你可以提供 feed 数据作为 run() 调用的参数. feed 只在调用它的方法内有效, 方法结束, feed 就会消失. 最常见的用例是将某些特殊的操作指定为 “feed” 操作, 标记的方法是使用 tf.placeholder() 为这些操作创建占位符.
import tensorflow as tfinput1 = tf.placeholder(tf.float32)input2 = tf.placeholder(tf.float32)output = tf.multiply(input1, input2)with tf.Session() as sess: print(sess.run([output], feed_dict={input1:[7.], input2:[2.]}))
未完待续
阅读全文
0 0
- tensorflow基础语法
- TensorFlow入门(基础语法,小程序)
- tensorflow 语法
- TensorFlow基础
- Tensorflow基础
- Tensorflow基础
- Tensorflow 基础
- Tensorflow基础
- tensorflow基础
- Tensorflow基础
- TensorFlow基础
- tensorflow基础
- Tensorflow基础
- tensorflow基本语法
- tensorflow基本语法理解
- tensorflow语法学习
- tensorflow 语法小结
- tensorflow基本语法
- 根据日期获得第几周数据
- Android Studio入门到精通
- 对于Java程序猿学习的建议
- 树的三种遍历方法代码实现 (数据结构)C语言
- POJ-2481 Cows (树状数组 入门题)
- tensorflow基础语法
- Hash Map / Hash Set
- 基于51单片机的寻迹小车制作(三)
- linux网络编程-----几种服务器模型及io多路复用函数
- 列出连通集
- 10.11
- R Note 统计基础
- java.lang.UnsupportedClassVersionError: org/apache/activemq/spring/ActiveMQConnectionFactory : Unsup
- 通用爬虫(搜索网站爬虫)