![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Tensorflow
a64506青竹
这个作者很懒,什么都没留下…
展开
-
【Tensorflow】辅助工具篇——tensorflow slim(TF-Slim)介绍
原文:https://blog.csdn.net/mao_xiao_feng/article/details/73409975可能很多tensorflow的老版本玩家没见过这个东西,slim这个模块是在16年新推出的,其主要目的是来做所谓的“代码瘦身”。但事实上它已经成为我比较喜欢,甚至是比较常用的模块,github上面大部分tensorflow的工程都会涉及到它,不得不说,撇开Keras...转载 2019-08-28 22:23:41 · 550 阅读 · 0 评论 -
tensorflow slim介绍
https://blog.csdn.net/grllery/article/details/79659466转载 2019-08-22 19:29:06 · 160 阅读 · 0 评论 -
使用Tensorflow构建LSTM模型所需要使用到的API
前言在使用tensorflow编写LSTM代码的时候Tensorflow使用LSTM实现中文文本分类(二),使用到很多新的函数,在此将用到的新函数整理一下做一个笔记。重要方法tf.random_uniform_initializer()功能:生成具有均匀分布的张量的初始化器参数:minval:一个 python 标量或一个标量张量.要生成的随机值范围的下限maxval:一个...转载 2019-07-25 12:34:36 · 520 阅读 · 0 评论 -
安装tensorflow gpu版本 成功案例-win10 py3.7 cuda10.0 cudnn7.5.1 Anaconda
百度云链接:https://pan.baidu.com/s/1ka1bYRugiZVHLRu2h9jl5A提取码:vmp0采坑无数,安了两天。主要是因为不兼容,不兼容,不兼容,重要的问题说三遍。首先,自己看过的很多,最稳妥的是win10 +py3.7 +cuda10.0 + cudnn7.5.1+ Anaconda3本文讲的是win10环境下gpu版本的tensorflow安装配...原创 2019-06-30 11:44:30 · 2652 阅读 · 0 评论 -
tf.nn.sampled_softmax_loss 和 tf.nn.nce_loss
TensorFlow实战 笔记——tf.nn.nce_loss:https://blog.csdn.net/qq_36092251/article/details/79684721tf.nn.sampled_softmax_loss候选采样损失函数:https://blog.csdn.net/wang263334857/article/details/96430541#commentBox...原创 2019-10-18 21:41:48 · 1126 阅读 · 0 评论 -
关于tensorflow: stack_bidirectional_dynamic_rnn、bidirecitonal_dynamic_rnn函数中sequence_length的理解
https://blog.csdn.net/dunlongzun8445/article/details/89454610转载 2019-10-17 21:25:00 · 479 阅读 · 0 评论 -
tf的ExponentialMovingAverage滑动平均实现
# -*- coding: utf-8 -*-"""Created on Fri Jan 11 22:34:48 2019@author: ZZL"""import tensorflow as tfw = tf.Variable([1.,1.])ema = tf.train.ExponentialMovingAverage(0.9)update = tf.assign_add(...原创 2019-09-13 14:58:45 · 180 阅读 · 0 评论 -
tensorflow里的,保存和恢复模型的3种方法
重点在于,第一个文件用于 训练,保存图meta和训练好的参数data(后缀),在另一个文件中导入这个图和训练好的参数,用于预测或者接着训练。大大减少了另一个文件里的 重复1. 第一种情况是,产生变量的代码和恢复变量的代码在同一个文件时,可以直接如下调用:# 建模型saver = tf.train.Saver() with tf.Session() as sess: ...原创 2019-09-09 11:38:34 · 297 阅读 · 0 评论 -
tf.reshape 和tf.transpose和tf.split
tf.reshape() tf.shape(x)与x.get_shape()2018年04月24日 15:20:15Li_haiyu阅读数:465tf.rehspe()用法 : tf.reshape(tensor, shape, name=None)>>> import tensorflow as tf>>> import numpy as ...原创 2019-01-10 23:49:57 · 801 阅读 · 0 评论 -
tf.matrix_diag和tf.matrix_inverse的用法(tensorflow如何生成对角矩阵和求逆矩阵)
1.tf.matrix_diag(dia):输入参数是dia,如果输入时一个向量,那就生成二维的对角矩阵,以此类推2.tf.matrix_inverse(A):输入如果是一个矩阵,就是得到逆矩阵,依次类推,只是输入的A中的元素需要是浮点数,比如tf.float32等格式,如果是整形,就会出错哈。例如:矩阵(二维张量)import tensorflow as tf;A = [1...原创 2019-01-11 21:14:03 · 4423 阅读 · 2 评论 -
tf.linspace和np.linspace的对比分析
解释:tf.linspace(start, end, num):这个函数主要的参数就这三个,start代表起始的值,end表示结束的值,num表示在这个区间里生成数字的个数,生成的数组是等间隔生成的。start和end这两个数字必须是浮点数,不能是整数,如果是整数会出错的,请注意!np.linspace(start, end, num):主要的参数也是这三个,我们平时用的时候绝大多数时候就...原创 2019-01-11 21:36:38 · 5065 阅读 · 0 评论 -
tf.random_uniform的使用
tf.random_uniform((4, 4), minval=low,maxval=high,dtype=tf.float32)))返回4*4的矩阵,产生于low和high之间,产生的值是均匀分布的。例如:import tensorflow as tfimport numpy as npwith tf.Session() as sess: print(sess.run(...原创 2019-01-11 22:20:12 · 727 阅读 · 0 评论 -
Tensorflow–tf.assign()详解
Tensorflow–tf.assign()详解转自:http://www.soaringroad.com/?p=194tf.assgin()函数很具有被误解的潜质,如果不是非常透彻理解tensorflow graph 和 op 的概念的话,一不小心就会计算错误……. 先来看下源代码: def assign(ref, value, validate_shape=None, ...原创 2019-01-11 22:26:00 · 577 阅读 · 0 评论 -
tf.nn.dynamic_rnn的输出outputs和state含义
代码解释:https://blog.csdn.net/u010960155/article/details/81707498lsmt解释:https://blog.csdn.net/demons__/article/details/79208268代码直接可用的,不懂的看注释,最好先看 LSTM 的结构解释import tensorflow as tfimport numpy a...原创 2019-08-22 22:03:05 · 574 阅读 · 0 评论 -
tf.clip_by_norm 梯度裁剪
写的,清晰明了转载:https://blog.csdn.net/wn87947/article/details/82345537#!/usr/bin/env python# -*- coding: utf-8 -*-# @Time : 2019/9/4 22:56# @Author : ZZL# @File : tf.clip_by_norm梯度裁剪.pyimport...原创 2019-08-22 08:57:19 · 717 阅读 · 0 评论 -
tf.Variable()和tf.get_variable()对比
1-4原文链接:https://blog.csdn.net/u012223913/article/details/785339101. tf.Variable()W = tf.Variable(<initial-value>, name=<optional-name>)用于生成一个初始值为initial-value的变量。必须指定初始化值2.tf.get_v...原创 2019-08-17 08:16:58 · 125 阅读 · 0 评论 -
【Tensorflow】 tf.train.slice_input_producer 和 tf.train.batch 函数
tensorflow数据读取机制tensorflow中为了充分利用GPU,减少GPU等待数据的空闲时间,使用了两个线程分别执行数据读入和数据计算。具体来说就是使用一个线程源源不断的将硬盘中的图片数据读入到一个内存队列中,另一个线程负责计算任务,所需数据直接从内存队列中获取。tf在内存队列之前,还设立了一个文件名队列,文件名队列存放的是参与训练的文件名,要训练 N个epoch,则文件名队...转载 2019-08-12 20:29:12 · 118 阅读 · 0 评论 -
详解tf.app.flags()和tf.app.run()的源码
转载:https://www.jianshu.com/p/55cbd3753ee8经常在程序中看到有tf.app.flags和tf.app.run字样的代码,这两段代码究竟是什么作用,就让我们从分析源码的角度来加深理解!tf.app.flagstf.app.flags主要用于处理命令行参数的解析工作,其实可以理解为一个封装好了的argparse包(argparse是一种结构化的数据存储...原创 2019-08-12 17:21:15 · 676 阅读 · 0 评论 -
tf.slice
tf.slice函数为:tf.slice( input_, begin, size, name=None)官网描述为:This operation extracts a slice of sizesizefrom a tensorinputstarting at the location specified bybegin翻译为:从原始输...原创 2019-08-12 16:22:24 · 121 阅读 · 0 评论 -
tf.while_loop()循环 实现
https://blog.csdn.net/u011509971/article/details/78805727转载 2019-08-08 16:03:15 · 591 阅读 · 0 评论 -
用tensorflow实现,验证tf.nn.softmax_cross_entropy_with_logits的过程
# -*- coding: utf-8 -*-"""Created on Mon Dec 24 21:32:37 2018@author: ZZL"""import tensorflow as tfimport time#our NN's outputlogits=tf.constant([[1.0,2.0,3.0], [1...原创 2019-07-28 07:52:50 · 182 阅读 · 0 评论 -
tf的concat、contatenate stack
import tensorflow as tfimport numpy as np# tf.concat和 np.concatenate一样的a1 = np.random.randint(1,9,[4,3])a2 = np.random.randint(1,9,[4,2])a3 = tf.concat((a1, a2),axis=1)sess = tf.Session()prin...原创 2019-06-18 17:14:07 · 212 阅读 · 0 评论 -
tf.assign, tf.while_loop的一些理解和坑
原文:https://blog.csdn.net/ziliwangmoe/article/details/81297548#commentBox炎炎夏天,如果如果还开个满负荷运转的GPU机器训练模型。看着变幻莫测的误差下降曲线,真的有种在炼丹的感觉。如果你还用TensorFlow,这种不可捉摸的感觉又添加几分,这里就用tf.assign, tf.while_loop两个函数来举例。...转载 2019-09-04 09:35:12 · 610 阅读 · 0 评论