随笔分类 - tensorflow
摘要:softplus: softplus(x) = log(exp(x) + 1) 许多激活函数之一是Softplus函数,其定义为。
阅读全文
摘要:tile() 平铺之意,用于在同一维度上的复制 tile( input, #输入 multiples, #同一维度上复制的次数 name=None ) with tf.Graph().as_default(): a = tf.constant([1,2],name='a') b = tf.tile(
阅读全文
摘要:tf.random_normal(shape, mean=0.0, stddev=1.0, dtype=tf.float32, seed=None, name=None) tf.random_normal()函数用于从“服从指定正态分布的序列”中随机取出指定个数的值。 shape: 输出张量的形状,
阅读全文
摘要:tf.cast()函数的作用是执行 tensorflow 中张量数据类型转换,比如读入的图片如果是int8类型的,一般在要在训练前把图像的数据格式转换为float32。 cast(x, dtype, name=None) 第一个参数 x: 待转换的数据(张量) 第二个参数 dtype: 目标数据类型
阅读全文
摘要:tensorflow中的tile()函数是用来对张量(Tensor)进行扩展的,其特点是对当前张量内的数据进行一定规则的复制。最终的输出张量维度不变。 函数定义: tf.tile(input,multiples,name=None)input是待扩展的张量,multiples是扩展方法。假如inpu
阅读全文
摘要:tf.identity( input, name=None ) #Return a tensor with the same shape and contents as input. #返回一个tensor,contents和shape都和input的一样 y = tf.identity(x)是一个
阅读全文
摘要:import tensorflow as tf # Build a graph. a = tf.constant([1.0, 2.0]) b = tf.constant([3.0, 4.0]) c = a * b with tf.Session() as sess: print sess.run(c
阅读全文