张量的最小 K 值? [英] Minimum K values of a tensor?
问题描述
我知道计算逆的实现(即 tf.nn.top_k 计算沿给定轴的 K 个最大值),但我找不到找到 K 最小的内置方法 值.
I am aware of an implementation to compute the inverse (i.e. tf.nn.top_k computes the K largest values along a given axis), but I can't find a in-built method to find the K smallest values.
除了取逆或玩弄集合之外,是否可以使用 tensorflow 库来做到这一点,还是我必须自己设计一些东西?
Aside from taking the inverse or playing around with sets, is it possible to do this using the tensorflow library, or will I have to devise something myself?
干杯/
推荐答案
不,没有可以使用的单一功能.使用 tf.nn.top_k()
为此.只需否定论点:
No, there is no single function that you can use. There is no problem using tf.nn.top_k()
for this purpose. Just negate the argument:
-tf.nn.top_k(-A)
与 tf.negative(tf.nn.top_k(tf.negative(A))) 的作用相同
这篇关于张量的最小 K 值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!