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.
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?
Cheers/
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) will do the same as tf.negative(tf.nn.top_k(tf.negative(A)))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With