莫烦tensorflow(2)-Session
import os
os.environ['TF_CPP_MIN_LOG_LEVEL']='2'
import tensorflow as tf
matrix1 = tf.constant([[3,3]])
matrix2 = tf.constant([[2],[2]])
protuct = tf.matmul(matrix1,matrix2)
# sess = tf.Session()
# result = sess.run(protuct)
# print(result)
# sess.close()
with tf.Session() as sess:
result = sess.run(protuct)
print(result)
莫烦tensorflow(2)-Session的更多相关文章
- 莫烦tensorflow(9)-Save&Restore
import tensorflow as tfimport numpy as np ##save to file#rember to define the same dtype and shape w ...
- 莫烦tensorflow(8)-CNN
import tensorflow as tffrom tensorflow.examples.tutorials.mnist import input_data#number 1 to 10 dat ...
- 莫烦tensorflow(7)-mnist
import tensorflow as tffrom tensorflow.examples.tutorials.mnist import input_data#number 1 to 10 dat ...
- 莫烦tensorflow(6)-tensorboard
import tensorflow as tfimport numpy as np def add_layer(inputs,in_size,out_size,n_layer,activation_f ...
- 莫烦tensorflow(5)-训练二次函数模型并用matplotlib可视化
import tensorflow as tfimport numpy as npimport matplotlib.pyplot as plt def add_layer(inputs,in_siz ...
- 莫烦tensorflow(4)-placeholder
import tensorflow as tf input1 = tf.placeholder(tf.float32)input2 = tf.placeholder(tf.float32) outpu ...
- 莫烦tensorflow(3)-Variable
import tensorflow as tf state = tf.Variable(0,name='counter') one = tf.constant(1) new_value = tf.ad ...
- 莫烦tensorflow(1)-训练线性函数模型
import tensorflow as tfimport numpy as np #create datax_data = np.random.rand(100).astype(np.float32 ...
- tensorflow学习笔记-bili莫烦
bilibili莫烦tensorflow视频教程学习笔记 1.初次使用Tensorflow实现一元线性回归 # 屏蔽警告 import os os.environ[' import numpy as ...
随机推荐
- HDu4794 斐波那契循环节
题意:Arnold变换把矩阵(x,y)变成((x+y)%n,(x+2*y)%n),问最小循环节 题解:仔细算前几项能看出是斐波那契数论modn,然后套个斐波那契循环节板子即可 //#pragma GC ...
- hadoop中发送文件的脚本
多台主机执行相同的命令 [xcall] [/usr/local/bin] sudo nano xcall ----------------------------------------------- ...
- set unused的用法(ORACLE删除字段)
set unused的用法(ORACLE删除字段) 一.问题 现场有一张大数据量的分区表,数据量在10G以上.因某种原因需要删除其中的某些字段.如果直接用alter table1 drop (colu ...
- vmplayer桥接以及nat配置nginx
1.环境 centos6.4 vm player nginx1.8 2.虚拟机的防火墙 参考http://blog.csdn.net/qilovehua/article/details/4550713 ...
- 前端页面兼容ie8解决方法
一.通用兼容文件的引用: 1.HTML5标签兼容方案:html5shiv.js GitHub地址:https://github.com/aFarkas/html5shiv/ IE8不支持HTML5的新 ...
- poj1002 大数的 n的m次
import java.math.BigDecimal; import java.util.Scanner; public class Main { public static void main(S ...
- CP-ABE的使用
参考: http://acsc.cs.utexas.edu/cpabe/tutorial.html http://acsc.cs.utexas.edu/cpabe/ 事先先配置好cp-abe:http ...
- 浅谈MSSQL2012中的列存储索引(columnstore indexes)
列存储索引为MSSQL2012版本中引进的一个新特性.所有版本MSSQL中标准查询处理模式采用一次一行模型,操作符每次处理一行数据.列存储索引中增加了一种新的基于向量的查询执行功能,通过这种功能,操作 ...
- Physical Limits of ASM
Oracle version 7, only 1,022 datafiles per database could be used. Oracle version 11g, support 65,5 ...
- xpath 获取表单的值
<input type="hidden" id="hospital_id" value="6666sui"> $selector ...