
机器学习
66565906
这个作者很懒,什么都没留下…
展开
-
Tensorflow手写识别
代码from tensorflow.examples.tutorials.mnist import input_dataimport tensorflow as tfimport matplotlib as mpimport matplotlib.pyplot as plotmnist = input_data.read_data_sets("MnisData", one_hot...原创 2018-11-20 16:40:32 · 371 阅读 · 0 评论 -
numpy.hstack, numpy.vstack 用法
numpy.hstack 等价于 np.concatenate( axis = 1) numpy.vstack 等价于 np.concatenate( aix=0) np.concatenate 用法请 参见 https://blog.youkuaiyun.com/G66565906/article/details/84942038原创 2018-12-10 16:34:48 · 572 阅读 · 0 评论 -
numpy.stack 与 numpy.concatenate 用法
在功能上 numpy.stack 与 numpy.concatenate 很相似,在使用上时常常搞混,两都之间最重要的一个区别时stack会增加一个维度,而concatenate不会增加维度,只是简单地完成拼接 以下数组为例a = np.array( [ [ 1, 2 ], [3, 4 ]] )b = np.array( [ [ 5...原创 2018-12-10 16:29:40 · 2256 阅读 · 1 评论 -
Tensorflow 卷积操作示例
代码import tensorflow as tfimport matplotlib.pyplot as plt#读取jpg文件original_data = tf.read_file("test.jpg")#解析数据img_data = tf.image.decode_jpeg(original_data)img_data = tf.cast(img_data, tf.f...原创 2018-11-20 12:32:40 · 1388 阅读 · 0 评论 -
tensorboard 不显示数据
1:在cmd中将路径定位至log目录的上一级路径2:在cmd中执行 tensorboard --logdir = log原创 2018-11-18 15:58:06 · 948 阅读 · 0 评论 -
Tensorflow函数拟合sin
代码: import tensorflow as tfimport matplotlib.pyplot as pyplotfileQueue = tf.train.string_input_producer(["e:\\simdata.tf"])tfReader = tf.TFRecordReader()_, item = tfReader.read(fileQueue)fe...原创 2018-11-19 16:53:11 · 1761 阅读 · 0 评论 -
TFRecord 读写示例
格式为统一数据的存储, Tensorflow提供了一种通用数据格式message Example { Features features = 1;};message Features { map<string, Feature> feature = 1;};message Feature { oneof kind { BytesList byt...原创 2018-11-19 10:17:15 · 926 阅读 · 0 评论 -
np.hstack 用法
np.hstack将参数元组的元素数组按水平方向进行叠加import numpy as nparr1 = np.array([[1,3], [2,4] ])arr2 = np.array([[1,4], [2,6] ])res = np.hstack((arr1, arr2))print (res)#[[1 3 1 4] [2 4 2 6]]import numpy...原创 2018-11-16 16:48:01 · 86938 阅读 · 2 评论 -
tf.reduce_sum 用法
tf.reduce_sum 的功能描述原文为: """Computes the sum of elements across dimensions of a tensor. Reduces `input_tensor` along the dimensions given in `axis`. Unless `keepdims` is true, the rank of the t...原创 2018-11-16 16:24:14 · 1086 阅读 · 0 评论 -
tf.gather_nd 用法
tf.gather_nd的函数原型是:def gather_nd(params, indices, name=None)根据定义, 其主要功能是根据indices描述的索引,提取params上的元素, 重新构建一个tensor在谈论该函数之前,我们先来看一下 索引的概念,在一维数组中,元素的索引即该元素在数组中序号,通常序号从0开始标记如数组 ary=[1,2,3,4];...原创 2018-12-11 08:55:22 · 16154 阅读 · 7 评论