tensorflow:: ops:: InTopK

#include <nn_ops.h>

対象が上位K予測に含まれているかどうかを示します。

まとめ

これはbatch_sizeブール配列を出力しますInTopK例えばiの場合、対象クラスの予測がすべての予測の中で上位k予測に含まれている場合、 out[i]のエントリはtrueになります。InTopK の動作は、同順位の処理においてTopK op とは異なることに注意してください。複数のクラスが同じ予測値を持ち、上位k境界をまたいでいる場合、それらのクラスはすべて上位kに含まれているとみなされます。

より正式には、

\(predictions_i\) 例えば、 iのすべてのクラスの予測値です。 \(targets_i\) 例えば、対象クラスはiです。 \(out_i\) 例えばi出力は、

$$out_i = predictions_{i, targets_i} TopKIncludingTies(predictions_i)$$

議論:

  • スコープ:スコープオブジェクト
  • 予測: batch_size x classesテンソル。
  • ターゲット: クラスIDのbatch_sizeベクトル。
  • k: 精度を計算する際に参照する上位要素の数。

返品:

  • Output : kにおける計算された精度をbool Tensorとして返します。

コンストラクターとデストラクタ

InTopK (const :: tensorflow::Scope & scope, :: tensorflow::Input predictions, :: tensorflow::Input targets, int64 k)

公開属性

operation
precision

公的機能

node () const
::tensorflow::Node *
operator::tensorflow::Input () const
operator::tensorflow::Output () const

公開属性

手術

Operation operation

精度

::tensorflow::Output precision

公的機能

InTopK

 InTopK(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input predictions,
  ::tensorflow::Input targets,
  int64 k
)

ノード

::tensorflow::Node * node() const 

operator::tensorflow::Input

 operator::tensorflow::Input() const 

operator::tensorflow::Output

 operator::tensorflow::Output() const