tensorflow
我是白小纯
李慢慢,你叫慢慢为什么每次都是最快的那个呢?
李慢慢身份:书院大师兄
看了将夜,几个月了,只这句话忘不掉。
向慢慢看齐!!
展开
-
ValueError: You can only pass an initializer function that expects no arguments to its callable when
tensorflow初始化报错:ValueError: You can only pass an initializer function that expects no arguments to its callable when the shape is not fully defined. The given initializer function expects the following args [‘shape’, ‘dtype’, ‘partition_info’]原因:是因为定义维原创 2020-08-04 11:38:04 · 896 阅读 · 0 评论 -
tf.one_hot()使用
tf.one_hot在看conditionGAN的时候注意到label的输入要把它转换成one-hot形式,再与噪声z进行tf.concat输入,之前看的时候忽略了,现在再看才算明白为什么。tf.one_hot( indices,#输入,这里是一维的 depth,# one hot dimension. on_value=None,#output 默认1 off_va原创 2017-10-11 19:41:11 · 26735 阅读 · 5 评论 -
Tensorflow 提示list indices must be integers, not Tensor ?
当用到list的时候想要根据索引取值,不过索引的值和总体训练步数global_step有关,这是个tensorglobal_step = tf.contrib.framework.get_or_create_global_step()当取值时就变成了List[i]#i是tensor类型。 结果提示list indices must be integers, not Tensor 首先想到之前的t原创 2017-11-29 17:20:43 · 6042 阅读 · 0 评论 -
tf.nn.l2_loss和 tf.nn.l2_normalize
一,L2正则化:tf.nn.l2_loss形如1/2Σw21/2Σw21/2\Sigma w^2,一般用于优化的目标函数中的正则项,防止参数太多复杂容易过拟合。tf.nn.l2_loss(var)Computes half the L2 norm of a tensor without the `sqrt`: output = sum(t ** 2) / 2不过在这里又...原创 2018-03-21 19:59:45 · 9244 阅读 · 0 评论 -
tf.assign
tf.assign在tensorflow起到赋值的作用,对g进行assign后g的值就变成新的值,同时返回的也是新的值。 一旦assign被session run之后,g的值就会变成新的值。这里要特别注意,不然可能造成值溢出。#!/usr/bin/env python3# -*- coding: utf-8 -*-import tensorflow as tfimport osos...原创 2018-03-22 11:23:22 · 2241 阅读 · 0 评论 -
batchrenorm代码
class batch_renorm(): def __init__(self, n_out,renorm_momentum=0.97, RMAX=1, DMAX=0,epsilon=1e-3): self.n_out = n_out self.moving_mean = _variable_on_cpu('moving_mean...原创 2018-05-03 11:01:18 · 325 阅读 · 0 评论 -
Highway Network
转载自https://blog.csdn.net/qq_32782339/article/details/78877908 Highway Network主要解决的问题是,网络深度加深,梯度信息回流受阻造成网络训练困难的问题。假设定义一个非线性变换为 H(x,WH)H(x,WH)H(x,W_{H})定义门函数,携带函数1−T1−T1-T。 门函数取sigmoid,值在0-1之间,不...转载 2018-07-08 23:15:46 · 1310 阅读 · 1 评论 -
anaconda3+tensorflow1.2gpu
1、从官网下载anaconda3 linuxhttps://www.anaconda.com/download/#linux 终端运行 bash Anaconda3-5.2.0-Linux-x86_64 然后就是一直yes,记得添加环境变量也是yes。 vim ~/.bashrc 加上下面的环境变量,/home/anaconda2/bin是安装的地址。export PATH=...原创 2018-08-24 09:13:10 · 388 阅读 · 0 评论