tf.keras.ops.digitize
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
Returns the indices of the bins to which each value in x belongs.
tf.keras.ops.digitize(
x, bins
)
Args |
x
|
Input array to be binned.
|
bins
|
Array of bins. It has to be one-dimensional and monotonically
increasing.
|
Returns |
Output array of indices, of same shape as x.
|
Example:
x = np.array([0.0, 1.0, 3.0, 1.6])
bins = np.array([0.0, 3.0, 4.5, 7.0])
keras.ops.digitize(x, bins)
array([1, 1, 2, 1])
如未另行说明,则本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。如需了解详情,请参阅 Google Developers 网站政策。Java 是 Oracle 和/或其关联公司的注册商标。某些内容已根据 Numpy 许可获得了许可。
最后更新时间 (UTC):2024-06-07。
[null,null,["最后更新时间 (UTC):2024-06-07。"],[],[]]