上一页 1 ··· 40 41 42 43 44 45 46 47 48 ··· 56 下一页

2019年5月7日

摘要: tf.nn.relu ( features, name = None ) 解释:这个函数的作用是计算激活函数 relu,即 max ( features, 0 )输入参数:features: 一个Tensor。数据类型必须是:float32,float64,int3, int64,uint8,int 阅读全文
posted @ 2019-05-07 11:13 happygril3 阅读(143) 评论(0) 推荐(0)
摘要: 评估操作对于测量神经网络的性能是有用的。 由于它们是不可微分的,所以它们通常只是被用在评估阶段 tf.nn.top_k(input, k, name=None) 这个函数的作用是返回 input 中每行最大的 k 个数,并且返回它们所在位置的索引。 输入参数: input: 一个张量,数据类型必须是 阅读全文
posted @ 2019-05-07 10:56 happygril3 阅读(541) 评论(0) 推荐(1)
摘要: 创建一个常数张量,传入list或者数值来填充 tensor = tf.constant([1, 2, 3, 4, 5, 6, 7]) with tf.Session() as sess: print(sess.run(tensor)) a = tf.constant([1, 2, 3, 4, 5, 阅读全文
posted @ 2019-05-07 10:43 happygril3 阅读(149) 评论(0) 推荐(0)
摘要: 想要增加一维,可以使用tf.expand_dims(input, dim, name=None)函数 t = np.array(np.arange(1, 1 + 30).reshape([2, 3, 5]), dtype=np.float32) array([[[ 1., 2., 3., 4., 5 阅读全文
posted @ 2019-05-07 10:17 happygril3 阅读(290) 评论(0) 推荐(0)

2019年4月30日

摘要: import tensorflow as tfimport numpy as np 1.tf.placeholder placeholder()函数是在神经网络构建graph的时候在模型中的占位,此时并没有把要输入的数据传入模型,它只会分配必要的内存。 等建立session,在会话中,运行模型的时候 阅读全文
posted @ 2019-04-30 10:30 happygril3 阅读(388) 评论(0) 推荐(0)

2019年4月28日

摘要: (1)ndarray 与 scipy.sparse.csr.csr_matrix 的互转 import numpy as npfrom scipy import sparse 1.1 ndarry 转 csr_matrix A = np.array([[1,2,0],[0,0,3],[1,0,4]] 阅读全文
posted @ 2019-04-28 11:16 happygril3 阅读(267) 评论(0) 推荐(0)

2019年4月26日

摘要: build-image.sh docker build --rm -t sidazhou/scipy-notebook:GEM start-container.sh sudo docker run -itd \ -p 8889:8888 \ --name GEM \ --user root \ -e 阅读全文
posted @ 2019-04-26 14:44 happygril3 阅读(162) 评论(0) 推荐(0)

2019年4月24日

摘要: 下载网址:https://hub.docker.com/r/tensorflow/tensorflow/tags 1. sudo docker pull tensorflow/tensorflow:1.12.0 2.docker run;创建容器时启动容器 -d 后台运行容器,并返回容器ID; -v 阅读全文
posted @ 2019-04-24 14:47 happygril3 阅读(135) 评论(0) 推荐(0)

2019年4月23日

摘要: 网址:https://docs.docker.com/install/linux/docker-ce/ubuntu/ Install using the repository Before you install Docker CE for the first time on a new host 阅读全文
posted @ 2019-04-23 15:00 happygril3 阅读(84) 评论(0) 推荐(0)

2019年4月22日

摘要: tf.app.flags主要用于处理命令行参数的解析工作,可以理解为一个封装好了的argparse包(argparse是一种结构化的数据存储格式,类似于Json、XML) 1.导入了argparse包 2.创建一个解析器对象,argparse中的解析器类是ArgumentParser 3.定义_Fl 阅读全文
posted @ 2019-04-22 15:32 happygril3 阅读(191) 评论(0) 推荐(0)
上一页 1 ··· 40 41 42 43 44 45 46 47 48 ··· 56 下一页

导航