自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(119)
  • 收藏
  • 关注

转载 TensorFlow之tf.unstack学习循环神经网络中用到

tf.stack和tf.unstack分别表示矩阵的合并和分解,下面用一个小示例演示用法import tensorflow as tfimport sysimport osimport numpy as npa = tf.constant([1 , 2 , 3])b = tf.constant([4 , 5 , 6])c = tf.stack([a , b] , axis=0)d...

2018-07-11 21:40:55 260

转载 TensorFlow上实现AutoEncoder自编码器

2018-07-11 20:21:52 349

转载 autoencoder的Python实现(1)

autoencoder的Python实现(1)置顶2016年05月18日 21:49:16阅读数:6778这一段时间因为工作的原因,有了更多的时间,于是感兴趣学习了深度学习的相关内容,参考了大牛们编写MATLAB,C,Python等版本,自己重新捡起Python,小试牛刀,基本完成了autoencoder的主要功能,并通过小例子进行验证。什么是深度学习?深度学习的目的又是什么?深度学习即通过多层模...

2018-07-11 15:17:55 2044

转载 lab-10-5-mnist_nn_dropout

# Lab 10 MNIST and Dropoutimport tensorflow as tfimport random# import matplotlib.pyplot as pltfrom tensorflow.examples.tutorials.mnist import input_datatf.set_random_seed(777) # reproducibili...

2018-07-07 20:48:02 224

转载 lab-10-4-mnist_nn_deep

import tensorflow as tfimport random# import matplotlib.pyplot as pltfrom tensorflow.examples.tutorials.mnist import input_datatf.set_random_seed(777) # reproducibilitymnist = input_data.read...

2018-07-07 16:58:35 206

转载 # Lab 10 MNIST and Xavier

# Lab 10 MNIST and Xavierimport tensorflow as tfimport random# import matplotlib.pyplot as pltfrom tensorflow.examples.tutorials.mnist import input_datatf.set_random_seed(777) # reproducibilit...

2018-07-07 08:40:31 177

转载 【TensorFlow】tf.nn.softmax_cross_entropy_with_logits的用法

【TensorFlow】tf.nn.softmax_cross_entropy_with_logits的用法在计算loss的时候,最常见的一句话就是tf.nn.softmax_cross_entropy_with_logits,那么它到底是怎么做的呢?首先明确一点,loss是代价值,也就是我们要最小化的值tf.nn.softmax_cross_entropy_with_logits(logits,...

2018-07-06 14:49:51 206

转载 tf.contrib.layers.xavier_initializer

tf.contrib.layers.xavier_initializerxavier_initializer( uniform=True, seed=None, dtype=tf.float32)12345该函数返回一个用于初始化权重的初始化程序 “Xavier” 。这个初始化器是用来保持每一层的梯度大小都差不多相同。参数:uniform: 使用uniform或者norm...

2018-07-06 13:21:25 4931

转载 tf.get_variable函数的使用

tf.get_variable函数的使用2017年05月16日 18:47:52阅读数:19385tf.get_variable(name,  shape, initializer): name就是变量的名称,shape是变量的维度,initializer是变量初始化的方式,初始化的方式有以下几种:tf.constant_initializer:常量初始化函数tf.random_normal_in...

2018-07-06 13:16:15 352

转载 lab-10-1-mnist_softmax

# Lab 7 Learning rate and Evaluationimport tensorflow as tfimport random# import matplotlib.pyplot as pltfrom tensorflow.examples.tutorials.mnist import input_datatf.set_random_seed(777) # repro...

2018-07-05 21:56:24 170

转载 lab-09-3-xor-nn-wide-deep

import tensorflow as tfimport numpy as nptf.set_random_seed(777) # for reproducibilitylearning_rate = 0.1x_data = [[0, 0], [0, 1], [1, 0], [1, 1]]y_data = [[0], ...

2018-07-04 22:30:37 139

转载 lab-09-2-xor-nn

# Lab 9 XORimport tensorflow as tfimport numpy as nptf.set_random_seed(777) # for reproducibilitylearning_rate = 0.1x_data = [[0, 0], [0, 1], [1, 0], [1, 1]]y_da...

2018-07-04 22:07:18 112

转载 lab-09-1-xor

import tensorflow as tfimport numpy as nptf.set_random_seed(777) # for reproducibilitylearning_rate = 0.1x_data = [[0, 0], [0, 1], [1, 0], [1, 1]]y_data = [[0], ...

2018-07-04 20:45:51 96

转载 lab-07-4-mnist_introduction

# Lab 7 Learning rate and Evaluationimport tensorflow as tfimport randomimport matplotlib.pyplot as plttf.set_random_seed(777) # for reproducibilityfrom tensorflow.examples.tutorials.mnist impo...

2018-07-03 22:43:43 134

转载 lab-07-1-learning_rate_and_evaluation

import tensorflow as tftf.set_random_seed(777) # for reproducibilityx_data = [[1, 2, 1], [1, 3, 2], [1, 3, 4], [1, 5, 5], [1, 7, 5], [1, 2, 5], ...

2018-07-03 20:53:21 169

转载 tf.argmax 与 tf.arg_max

tf.argmax 与 tf.arg_max 用法相同,下面介绍 tf.argmax 用法tf.argmaxdef argmax(input, axis=None, name=None, dimension=None, output_type=dtypes.int64)numpy.argmax(a, axis...

2018-07-03 20:47:35 1012

转载 lab-06-1-softmax_classifier

# Lab 6 Softmax Classifierimport tensorflow as tftf.set_random_seed(777) # for reproducibilityx_data = [[1, 2, 1, 1], [2, 1, 3, 2], [3, 1, 3, 4], [4, 1, 5, 5], ...

2018-07-03 20:23:45 124

转载 tensorflow--tf.one_hot()函数示例

2017年09月21日 19:11:18阅读数:8454tensorflow中tf.one_hot()函数的作用是将一个值化为一个概率分布的向量,一般用于分类问题。具体用法以及作用见以下代码:import numpy as npimport tensorflow as tf SIZE=6CLASS=8label1=tf.constant([0,1,2,3,4,5,6,7])sess1=tf.Ses...

2018-07-03 20:23:36 315

转载 TensorFlow的reshape操作 tf.reshape

TensorFlow的reshape操作 tf.reshape初学tensorflow,如果写的不对的,请更正,谢谢!tf.reshape(tensor, shape, name=None) 函数的作用是将tensor变换为参数shape的形式。 其中shape为一个列表形式,特殊的一点是列表中可以存在-1。-1代表的含义是不用我们自己指定这一维的大小,函数会自动计算,但列表中只能存在一个-1。(...

2018-07-03 20:23:26 648

转载 lab-06-2-softmax_zoo_classifier

import tensorflow as tfimport numpy as nptf.set_random_seed(777) # for reproducibility# Predicting animal type based on various featuresxy = np.loadtxt('data-04-zoo.csv', delimiter=',', dtype=np...

2018-07-03 20:22:29 148

转载 TensorFlow的reduce_sum()函数

TensorFlow的reduce_sum()函数2017年05月20日 09:24:53阅读数:8656日期:2017.5.20导师让下周二之前用TensorFlow把MNIST跑通,今天看源码碰到这么一行,发现TensorFlow里面的求和函数和其他语言差别挺大,便记录下来。import tensorflow as tf...# 交叉熵评估代价cross_entropy = tf.r...

2018-07-02 15:53:20 202

转载 lab-05-2-logistic_regression_diabetes

# Lab 5 Logistic Regression Classifierimport tensorflow as tfimport numpy as nptf.set_random_seed(777) # for reproducibilityxy = np.loadtxt('data-03-diabetes.csv', delimiter=',', dtype=np.float3...

2018-07-02 13:43:06 109

转载 lab-05-1-logistic_regression

# Lab 5 Logistic Regression Classifierimport tensorflow as tftf.set_random_seed(777) # for reproducibilityx_data = [[1, 2], [2, 3], [3, 1], [4, 3], [5, 3],...

2018-07-02 13:14:57 142

转载 tensorflow学习之tf.cast类型转换函数

nsorflow学习之tf.cast类型转换函数tf.cast(x, dtype, name=None) //此函数是类型转换函数,把x的类型转换成dtype指定的类型Args: x: A Tensor or SparseTensor.dtype: The destination type.name: A name for the operation (optional).Returns: A T...

2018-07-02 12:57:39 619 1

转载 函数 tf.cast()

一、函数 tf.cast()cast( x, dtype, name=None)将x的数据格式转化成dtype.例如,原来x的数据格式是bool, 那么将其转化成float以后,就能够将其转化成0和1的序列。反之也可以 二、例子【code】a = tf.Variable([1,0,0,1,1])b = tf.cast(a,dtype=tf.bool)sess = tf...

2018-07-02 12:41:13 276

转载 警告:Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA

警告:Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA2018年03月26日 11:45:59阅读数:8335问题:安装TensorFlow(CPU版本),使用pip install tensorflow安装,安装一切顺利,但是在跑一个简单的程序时,遇到如下情况:...

2018-07-02 10:35:00 83

转载 tensorflow中协调器 tf.train.Coordinator 和入队线程启动器 tf.train.start_queue_runners

2018年04月01日 18:51:57阅读数:1694TensorFlow的Session对象是支持多线程的,可以在同一个会话(Session)中创建多个线程,并行执行。在Session中的所有线程都必须能被同步终止,异常必须能被正确捕获并报告,会话终止的时候, 队列必须能被正确地关闭。TensorFlow提供了两个类来实现对Session中多线程的管理:tf.Coordinator和 tf.Q...

2018-07-02 10:18:47 128

转载 神经网络2. epoch, iteration, batchsize相关理解和说明

神经网络2. epoch, iteration, batchsize相关理解和说明本文为原创文章转载请注明出处:http://blog.csdn.NET/qq_20259459  和作者信息。原文超链接(点击阅读原文)batchsize:中文翻译为批大小(批尺寸)。简单点说,批量大小将决定我们一次训练的样本数目。batch_size将影响到模型的优化程度和速度。为什么需要有 Batch_Size ...

2018-07-02 10:00:09 155

转载 TensorFlow读取CSV数据

TensorFlow读取CSV数据2017-05-12 10:46 by 猎手家园, 1723 阅读, 0 评论, 收藏, 编辑代码来源于官方文档,做了一些小小的调整:# -*- coding:utf-8 -*-import tensorflow as tffilename_queue = tf.train.string_input_producer(["file01.csv", "file...

2018-07-02 09:45:54 253

转载 十图详解tensorflow数据读取机制(附代码)

十图详解tensorflow数据读取机制(附代码)何之源新书《21个项目玩转深度学习——基于TensorFlow的实践详解》已上线京东,天猫~603 人赞了该文章在学习tensorflow的过程中,有很多小伙伴反映读取数据这一块很难理解。确实这一块官方的教程比较简略,网上也找不到什么合适的学习材料。今天这篇文章就以图片的形式,用最简单的语言,为大家详细解释一下tensorflow的数据读取机制,文...

2018-07-02 09:25:06 121

转载 lab-04-3-file_input_linear_regression

# Lab 4 Multi-variable linear regressionimport tensorflow as tfimport numpy as nptf.set_random_seed(777) # for reproducibilityxy = np.loadtxt('data-01-test-score.csv', delimiter=',', dtype=np.fl...

2018-07-01 22:15:17 96

转载 lab-04-2-multi_variable_matmul_linear_regression

# Lab 4 Multi-variable linear regressionimport tensorflow as tftf.set_random_seed(777) # for reproducibilityx_data = [[73., 80., 75.], [93., 88., 93.], [89., 91., 90.], ...

2018-07-01 16:56:26 117

转载 lab-04-1-multi_variable_linear_regression

# Lab 4 Multi-variable linear regressionimport tensorflow as tftf.set_random_seed(777) # for reproducibilityx1_data = [73., 93., 89., 96., 73.]x2_data = [80., 88., 91., 98., 66.]x3_data = [75.,...

2018-07-01 15:41:33 106

转载 lab-03-X-minimizing_cost_tf_gradient

Lab 3 Minimizing Cost# This is optionalimport tensorflow as tftf.set_random_seed(777) # for reproducibility# tf Graph InputX = [1, 2, 3]Y = [1, 2, 3]# Set wrong model weightsW = tf.Variabl...

2018-07-01 15:21:19 117

转载 lab-03-3-minimizing_cost_tf_optimizer

import tensorflow as tftf.set_random_seed(777) # for reproducibility# tf Graph InputX = [1, 2, 3]Y = [1, 2, 3]# Set wrong model weightsW = tf.Variable(5.0)# Linear modelhypothesis = X * W...

2018-07-01 14:59:55 112

转载 Lab 3 Minimizing_Cost_ gradient_update

# Lab 3 Minimizing Costimport tensorflow as tftf.set_random_seed(777) # for reproducibilityx_data = [1, 2, 3]y_data = [1, 2, 3]# Try to find values for W and b to compute y_data = W * x_data +...

2018-07-01 11:49:40 124

转载 Lab 3 Minimizing Cost

# Lab 3 Minimizing Costimport tensorflow as tfimport matplotlib.pyplot as plttf.set_random_seed(777) # for reproducibilityX = [1, 2, 3]Y = [1, 2, 3]W = tf.placeholder(tf.float32)# Our hypot...

2018-07-01 11:25:34 211

转载 lab-02-3-linear_regression_tensorflow

# From https://www.tensorflow.org/get_started/get_startedimport tensorflow as tf# Model parametersW = tf.Variable([.3], tf.float32)b = tf.Variable([-.3], tf.float32)# Model input and outputx =...

2018-07-01 10:57:25 109

转载 Linear Regression_feed

# Lab 2 Linear Regressionimport tensorflow as tftf.set_random_seed(777) # for reproducibility# Try to find values for W and b to compute y_data = W * x_data + b# We know that W should be 1 and b...

2018-07-01 10:28:59 113

转载 Linear Regression

Lab 2 Linear Regressionimport tensorflow as tftf.set_random_seed(777) # for reproducibility# X and Y datax_train = [1, 2, 3]y_train = [1, 2, 3]# Try to find values for W and b to compute y_d...

2018-07-01 10:08:29 103

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除