返回值的直方图。
用法
tf.raw_ops.HistogramFixedWidth(
values, value_range, nbins, dtype=tf.dtypes.int32, name=None
)参数
-
values一个Tensor。必须是以下类型之一:int32,int64,float32,float64。数字Tensor。 -
value_range一个Tensor。必须与values具有相同的类型。形状 [2]Tensor与dtype与values相同。 values = value_range[1] 将被映射到 hist[-1]。 -
nbinsTensor类型为int32。标量int32 Tensor。直方图箱的数量。 -
dtype一个可选的tf.DType来自:tf.int32, tf.int64。默认为tf.int32。 -
name操作的名称(可选)。
返回
-
Tensor类型为dtype。
给定张量 values ,此操作返回排名 1 的直方图,计算 values 中落入每个 bin 的条目数。 bin 的宽度相等,由参数 value_range 和 nbins 确定。
# Bins will be: (-inf, 1), [1, 2), [2, 3), [3, 4), [4, inf)
nbins = 5
value_range = [0.0, 5.0]
new_values = [-1.0, 0.0, 1.5, 2.0, 5.0, 15]
with tf.get_default_session() as sess:
hist = tf.histogram_fixed_width(new_values, value_range, nbins=5)
variables.global_variables_initializer().run()
sess.run(hist) => [2, 1, 1, 0, 2]
相关用法
- Python tf.raw_ops.TPUReplicatedInput用法及代码示例
- Python tf.raw_ops.Bitcast用法及代码示例
- Python tf.raw_ops.SelfAdjointEigV2用法及代码示例
- Python tf.raw_ops.BatchMatMul用法及代码示例
- Python tf.raw_ops.OneHot用法及代码示例
- Python tf.raw_ops.ResourceScatterNdSub用法及代码示例
- Python tf.raw_ops.ReadVariableXlaSplitND用法及代码示例
- Python tf.raw_ops.GatherV2用法及代码示例
- Python tf.raw_ops.Expm1用法及代码示例
- Python tf.raw_ops.BitwiseAnd用法及代码示例
- Python tf.raw_ops.UniqueWithCounts用法及代码示例
- Python tf.raw_ops.DecodeGif用法及代码示例
- Python tf.raw_ops.Size用法及代码示例
- Python tf.raw_ops.ScatterUpdate用法及代码示例
- Python tf.raw_ops.ParallelConcat用法及代码示例
- Python tf.raw_ops.ScatterNdUpdate用法及代码示例
- Python tf.raw_ops.BatchToSpaceND用法及代码示例
- Python tf.raw_ops.TensorScatterMax用法及代码示例
- Python tf.raw_ops.DepthToSpace用法及代码示例
- Python tf.raw_ops.MutexLock用法及代码示例
注:本文由纯净天空筛选整理自tensorflow.org大神的英文原创作品 tf.raw_ops.HistogramFixedWidth。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。
