返回值的直方圖。
用法
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]。 -
nbins
Tensor
類型為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。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。