3.Fech_feed
- import tensorflow as tf
- # Fetch:可以在session中同时计算多个tensor或执行多个操作
- # 定义三个常量
- input1 = tf.constant(3.0)
- input2 = tf.constant(2.0)
- input3 = tf.constant(5.0)
- # 加法op
- add = tf.add(input2,input3)
- # 乘法op
- mul = tf.multiply(input1, add)
- with tf.Session() as sess:
- result1,result2 = sess.run([mul, add])
- print(result1,result2)
- # Feed:先定义占位符,等需要的时候再传入数据
- input1 = tf.placeholder(tf.float32)
- input2 = tf.placeholder(tf.float32)
- # 乘法op
- output = tf.multiply(input1, input2)
- with tf.Session() as sess:
- print(sess.run(output, feed_dict={input1:8.0,input2:2.0}))
3.Fech_feed的更多相关文章
- Tensorflow目录
0.Tensorflow安装 1.创建会话,启动会话 2.变量 3.Fech_feed 4.线性回归 5.非线性回归 6.MNIST数据集简单分类 7.交叉熵 8.Dropout 9.正则化 10.优 ...
随机推荐
- vue cli创建typescript项目
使用最新的Vue CLI @vue/cli创建typescript项目,使用vue -V查看当前的vue cli版本 安装命令 npm install -g @vue-cli 创建项目 vue cre ...
- centos6.5 单点kafka测试
一,kafka解压到/usr/local/下后,修改配置文件 vim config/zookeeper.properties 修改如下几行: dataDir=/usr/local/zookeeper/ ...
- nginx负载均衡高可用部署和代理配置
nginx负载均衡高可用配置 服务器A:172.16.100.2 服务器B:172.16.100.3 首先先在两台服务器上分别安装好nginx和keepalived后,再进行下面的操作 配置keepa ...
- 利用sklearn的Pipeline简化建模过程
很多框架都会提供一种Pipeline的机制,通过封装一系列操作的流程,调用时按计划执行即可.比如netty中有ChannelPipeline,TensorFlow的计算图也是如此. 下面简要介绍skl ...
- CSS - Animate动画
下载地址:https://daneden.github.io/animate.css/ 关键CSS样式:animate.css 引入CSS样式 <link rel="styleshee ...
- 如何限制nginx的响应速率
参考官方地址:http://nginx.org/en/docs/http/ngx_http_core_module.html#variables 用$limit_rate内置的变量可以限制nginx的 ...
- [转帖]docker容器保持运行不退出
docker容器保持运行不退出 2019年01月20日 23:21:22 chvalrous 阅读数 1511 版权声明:本文为博主原创文章,未经博主允许不得转载. https://blog.cs ...
- MYsql 客户端下载地址
workbench: https://www.mysql.com/cn/products/workbench/
- 【LOJ】#3043. 「ZJOI2019」线段树
LOJ#3043. 「ZJOI2019」线段树 计数转期望的一道好题-- 每个点设两个变量\(p,q\)表示这个点有\(p\)的概率有标记,有\(q\)的概率到祖先的路径上有个标记 被覆盖的点$0.5 ...
- 简单Kibana命令
1 查看健康状态 GET _cat/health?v epoch timestamp cluster status node.total node.data shards 1531290005 14: ...