
深度学习代码笔记
xbs118
梦里不知身是客,醒来方知一场空。
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
python的numpy库打乱数据集的实现
import numpy as np data = np.load('data.npy') # 数据集 rng = np.random.RandomState(2019) ind_shuf = list(range(len(data))) rng.shuffle(ind_shuf) data = data[ind_shuf] # 打乱数据集...原创 2019-07-18 21:40:25 · 3266 阅读 · 3 评论 -
tf.slice的理解
1 源代码注释的解释This operation extracts a slice of size size from a tensor input starting at the location specified by begin. The slice size is represented as tensor shape, where size[i] is the number of ...原创 2019-07-29 12:11:38 · 1551 阅读 · 0 评论 -
tensorflow 选择参数进行训练的方法
1 一般的训练过程train的过程其实就是修改计算图中的tf.Variable的过程。import tensorflow as tf label = tf.constant(1,dtype = tf.float32)prediction_to_train = tf.Variable(3,dtype=tf.float32) # 指定了待训练的变量(参数)manual_compute_l...转载 2019-07-28 10:45:34 · 3264 阅读 · 2 评论 -
tf.conv1d 和 tf.conv2d 的区别
tf.conv1d是实现一维卷积,tf.conv2d是实现二维卷积。当tf.conv2d的输入第二个或第三个维度为1时就等同于一维卷积了,详细见以下代码。import tensorflow as tfimport numpy as npinput = tf.constant([[[1], [7], [3], [2], [5], [6], [1]], [[11], [17], [13], ...原创 2019-08-02 08:44:01 · 3707 阅读 · 0 评论 -
TensorFlow 分布式 集群 部署
TensorFlow从0.8版本后即可进行分布式的集群部署,本文参考至 https://blog.youkuaiyun.com/sydpz1987/article/details/51340277 ,由TensorFlow分布式部署手册翻译而来。本文已默认您对TensorFlow和Python编程已经具有一定的基础。1 入门例子先来看一个例子。# Start a TensorFlow server a...转载 2019-08-10 21:09:06 · 2831 阅读 · 0 评论 -
from __future__ import absolute_import
关于这句from future import absolute_import的作用:直观地看就是说”加入绝对引入这个新特性”。说到绝对引入,当然就会想到相对引入。那么什么是相对引入呢?比如说,你的包结构是这样的:pkg/pkg/init.pypkg/main.pypkg/string.py如果你在main.py中写import string,那么在Python 2.4或之前, Pyth...转载 2019-08-18 14:29:58 · 491 阅读 · 0 评论