![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
tensorflow
文章平均质量分 56
MiniCnCoder
这个作者很懒,什么都没留下…
展开
-
Tensorflow卷积函数
转载自:https://blog.csdn.net/zSean/article/details/77837589卷积函数是在一批图像上扫描的二维过滤器。卷积函数定义在tensorflow-1.1.0/tensorflow/python/ops下的nn_impl.py和nn_ops.py文件中。(1)计算N维卷积的和的函数tf.nn.convolution()[html] view plain co...转载 2018-04-15 16:21:16 · 732 阅读 · 0 评论 -
tensorflow常用随机函数
转载自:https://blog.csdn.net/tz_zs/article/details/75948350tf.random_normal从正态分布输出随机值。[python] view plain copyrandom_normal(shape,mean=0.0,stddev=1.0,dtype=tf.float32,seed=None,name=None) shape:一个一维整数张量...转载 2018-04-15 16:27:58 · 2056 阅读 · 0 评论 -
tensorflow.cast(x, dtype, name=None)使用记录
tensorflow 中执行类型转换将变量x转换为dtype类型的新变量(x为序列,则对序列内元素转换)example:import tensorflow as tf a = tf.Variable([True,False,True]) b = tf.cast(a,dtype=tf.float32) with tf.Session() as sess: sess.run(tf.glo...原创 2018-04-11 21:08:00 · 700 阅读 · 0 评论 -
sparse_softmax_cross_entropy_with_logits
1、tf.nn.sparse_softmax_cross_entropy_with_logitstensorflow help info:tf.nn.sparse_softmax_cross_entropy_with_logits(labels=tf.argmax(y_,1),logits=y) #y_标签 y_.shape = [batch_size,num_class] tf.argmax(y...原创 2018-04-11 21:39:51 · 322 阅读 · 0 评论 -
tf.nn.softmax_cross_entropy_with_logits
tf.nn.softmax_cross_entropy_with_logits主要注意与下述接口区分tf.nn.sparse_softmax_cross_entropy_with_logitssparse_softmax_cross_entropy_with_logits( _sentinel=None, labels=None, logits=None, ...原创 2018-04-11 21:45:22 · 164 阅读 · 0 评论 -
tensorflow正则化惩罚项
import tensorflow as tf import tensorflow.contrib as contrib weight = tf.constant([[1.0, -2.0], [-3.0, 4.0]]) with tf.Session() as sess: # 输出为(|1|+|-2|+|-3|+|4|)*0.5=5 print(sess.run(contrib....原创 2018-04-11 21:49:14 · 1613 阅读 · 0 评论 -
tensorflow namescope 和 variablescope
上次说到了 TensorFlow 从文件读取数据,这次我们来谈一谈变量共享的问题。为什么要共享变量?我举个简单的例子:例如,当我们研究生成对抗网络GAN的时候,判别器的任务是,如果接收到的是生成器生成的图像,判别器就尝试优化自己的网络结构来使自己输出0,如果接收到的是来自真实数据的图像,那么就尝试优化自己的网络结构来使自己输出1。也就是说,生成图像和真实图像经过判别器的时候,要共享同一套变量,所以...转载 2018-04-19 16:41:19 · 1629 阅读 · 0 评论 -
tensorflow control_dependencies(self, control_inputs)以及identity(input, name=None)
参考链接:http://blog.csdn.net/m0_37041325/article/details/76943364https://stackoverflow.com/questions/34877523/in-tensorflow-what-is-tf-identity-used-fortf.control_dependencies(self, control_inputs)argume...转载 2018-04-19 17:33:18 · 281 阅读 · 0 评论