Tensorflow函数用法(持续扩充)
1. tf.clip_by_value
tf.clip\_by\_value(v,min,max)
:
给定一个张量v,将张量v中地每一个元素压缩到[min,max]的值域内。(小于min的置为min,大于max的置为max)。
2. tf.reduce_mean
沿着张量的指定的轴(某一维度),计算张量中元素的平均值。
#Computes the mean of elements across dimensions of a tensor
def reduce_mean(input_tensor,
axis=None,
keepdims=None,
name=None,
reduction_indices=None,
keep_dims=None):
Args:
_ input_tensor : The tensor to reduce. Should have numeric type.
axis : The dimensions to reduce. IfNone
(the default), reduces all dimensions. Must be in the range[-rank(input_tensor