Home
last modified time | relevance | path

Searched refs:top_k (Results 1 – 25 of 41) sorted by relevance

12

/external/tensorflow/tensorflow/lite/kernels/
Dtopk_v2.cc33 const TfLiteTensor* top_k = GetInput(context, node, kInputTopK); in ResizeOutput() local
35 TF_LITE_ENSURE_EQ(context, top_k->type, kTfLiteInt32); in ResizeOutput()
37 TF_LITE_ENSURE_EQ(context, NumElements(top_k), 1); in ResizeOutput()
38 const int32 k = *GetTensorData<int32_t>(top_k); in ResizeOutput()
179 const auto& top_k = topc.sorted_result(); in TopK() local
180 std::copy(top_k.begin(), top_k.end(), indexes_row); in TopK()
181 std::transform(top_k.begin(), top_k.end(), output_row, in TopK()
197 const TfLiteTensor* top_k = GetInput(context, node, kInputTopK); in Prepare() local
198 TF_LITE_ENSURE_EQ(context, top_k->type, kTfLiteInt32); in Prepare()
201 if (IsConstantTensor(top_k)) { in Prepare()
[all …]
Dtopk_v2_test.cc36 TopKV2OpModel(int top_k, std::initializer_list<int> input_shape, in TopKV2OpModel() argument
45 top_k_ = AddConstInput(TensorType_INT32, {top_k}, {1}); in TopKV2OpModel()
54 PopulateTensor<int32_t>(top_k_, {top_k}); in TopKV2OpModel()
/external/tensorflow/tensorflow/lite/tools/accuracy/ilsvrc/
Dimagenet_accuracy_eval.cc35 ResultsWriter::ResultsWriter(int top_k, const std::string& output_file_path) in ResultsWriter() argument
36 : top_k_(top_k) { in ResultsWriter()
51 columns.reserve(top_k); in ResultsWriter()
52 for (int i = 0; i < top_k; i++) { in ResultsWriter()
162 int top_k, const std::string& output_file_path) { in CreateImagenetEvalResultsWriter() argument
164 new ResultsWriter(top_k, output_file_path)); in CreateImagenetEvalResultsWriter()
Dimagenet_accuracy_eval.h34 ResultsWriter(int top_k, const std::string& output_file_path);
78 int top_k, const std::string& output_file_path);
/external/tensorflow/tensorflow/python/kernel_tests/
Dtopk_op_test.py51 values_op, indices_op = nn_ops.top_k(inputs, k, sorted=sorted)
199 values, _ = nn_ops.top_k(inputs, k)
208 nn_ops.top_k(inputs, 4)
214 values, _ = nn_ops.top_k(inputs, 3)
241 op = nn_ops.top_k(v, k)
/external/tensorflow/tensorflow/lite/experimental/kernels/
Dctc_beam_search.h248 const bool top_k = in Step() local
251 const int max_classes = top_k ? label_selection_size_ : (num_classes_ - 1); in Step()
254 if (top_k) { in Step()
335 const int label = top_k ? top_k_indices[ind] : ind; in Step()
336 const float logit = top_k ? top_k_logits[ind] : raw_input(ind); in Step()
/external/tensorflow/tensorflow/lite/examples/python/
Dlabel_image.py89 top_k = results.argsort()[-5:][::-1] variable
91 for i in top_k:
/external/tensorflow/tensorflow/compiler/tests/
Dsort_ops_test.py96 return nn_ops.top_k(v, k=k, sorted=True)
124 return nn_ops.top_k(v, k=k, sorted=True)
140 topk = nn_ops.top_k(p, k=4)
158 topk = nn_ops.top_k(p, k=6)
/external/tensorflow/tensorflow/python/compiler/tensorrt/test/
Dtopk_test.py35 values, indices = nn_ops.top_k(x, k_tensor, name="TopK")
56 values, indices = nn_ops.top_k(x, k_tensor, name="TopK")
/external/tensorflow/tensorflow/core/kernels/
Din_topk_op_test.cc36 static Graph* InTopK(int num_targets, int num_classes, T top_k) { in InTopK() argument
48 k_t.scalar<T>() = k_t.scalar<T>().constant(top_k); in InTopK()
Dtopk_op.cc191 std::unique_ptr<std::vector<int32>> top_k(filter.Extract()); in Compute() local
192 for (auto top_k_it = top_k->begin(); top_k_it != top_k->end(); in Compute()
/external/tensorflow/tensorflow/core/util/ctc/
Dctc_beam_search.h253 const bool top_k = in Step() local
257 top_k ? label_selection_size_ : (this->num_classes_ - 1); in Step()
260 if (top_k) { in Step()
340 const int label = top_k ? top_k_indices[ind] : ind; in Step()
341 const T logit = top_k ? top_k_logits[ind] : raw_input(ind); in Step()
/external/tensorflow/tensorflow/examples/speech_commands/
Dlabel_wav.py68 top_k = predictions.argsort()[-num_top_predictions:][::-1]
69 for node_id in top_k:
Dlabel_wav_dir.py77 top_k = predictions.argsort()[-num_top_predictions:][::-1]
78 for node_id in top_k:
/external/tensorflow/tensorflow/lite/tools/evaluation/stages/
Dtopk_accuracy_eval_stage.cc106 std::vector<int> top_k = GetTopKIndices(probabilities, params.k()); in Run() local
107 UpdateCounts(top_k); in Run()
/external/tensorflow/tensorflow/python/keras/utils/
Dmetrics_utils.py241 top_k=None, argument
353 if top_k is not None:
354 y_pred = _filter_top_k(y_pred, top_k)
472 _, top_k_idx = nn_ops.top_k(x, k, sorted=False)
/external/tensorflow/tensorflow/python/keras/
Dmetrics.py1176 top_k=None, argument
1199 self.top_k = top_k
1202 default_threshold = 0.5 if top_k is None else metrics_utils.NEG_INF
1236 top_k=self.top_k,
1253 'top_k': self.top_k,
1302 top_k=None, argument
1325 self.top_k = top_k
1328 default_threshold = 0.5 if top_k is None else metrics_utils.NEG_INF
1362 top_k=self.top_k,
1379 'top_k': self.top_k,
Dmetrics_confusion_matrix_test.py326 name='my_precision', thresholds=[0.4, 0.9], top_k=15, class_id=12)
332 self.assertEqual(p_obj.top_k, 15)
340 self.assertEqual(p_obj2.top_k, 15)
444 p_obj = metrics.Precision(top_k=3)
452 p_obj = metrics.Precision(top_k=3)
497 p_obj = metrics.Precision(class_id=2, top_k=2)
515 p_obj = metrics.Precision(thresholds=.7, top_k=2)
531 name='my_recall', thresholds=[0.4, 0.9], top_k=15, class_id=12)
537 self.assertEqual(r_obj.top_k, 15)
545 self.assertEqual(r_obj2.top_k, 15)
[all …]
/external/tensorflow/tensorflow/examples/label_image/
Dlabel_image.py137 top_k = results.argsort()[-5:][::-1] variable
139 for i in top_k:
/external/tensorflow/tensorflow/examples/tutorials/word2vec/
Dword2vec_basic.py292 top_k = 8 # number of nearest neighbors
293 nearest = (-sim[i, :]).argsort()[1:top_k + 1]
298 ', '.join([reverse_dictionary[nearest[k]] for k in range(top_k)]))
/external/tensorflow/tensorflow/lite/testing/op_tests/
Dtopk.py49 out = tf.nn.top_k(input_value, k)
/external/tensorflow/tensorflow/python/ops/
Dsort_ops.py198 values, indices = nn_ops.top_k(top_k_input, k)
/external/tensorflow/tensorflow/tools/api/golden/v2/
Dtensorflow.metrics.-recall.pbtxt116 …argspec: "args=[\'self\', \'thresholds\', \'top_k\', \'class_id\', \'name\', \'dtype\'], varargs=N…
/external/tensorflow/tensorflow/tools/api/golden/v1/
Dtensorflow.keras.metrics.-precision.pbtxt116 …argspec: "args=[\'self\', \'thresholds\', \'top_k\', \'class_id\', \'name\', \'dtype\'], varargs=N…
/external/tensorflow/tensorflow/compiler/aot/tests/
Dmake_test_graphs.py153 output = nn_ops.top_k(x, 2, name='values')

12