[Lite] num_ranks option brings to user through cmd line parameter
num_ranks optional parameters provides to user to calculate accuracy ranks on out file.
This commit is contained in:
parent
ad6e2c74ce
commit
668bd2a76f
@ -56,6 +56,10 @@ and the following optional parameters:
|
||||
Optionally, the computed accuracies can be output to a file as a
|
||||
string-serialized instance of tflite::evaluation::TopkAccuracyEvalMetrics.
|
||||
|
||||
* `num_ranks`: `int` (default=10) \
|
||||
The number of top-K accuracies to return. For example, if num_ranks=5,
|
||||
top-1 to top-5 accuracy fractions are returned.
|
||||
|
||||
The following optional parameters can be used to modify the inference runtime:
|
||||
|
||||
* `num_interpreter_threads`: `int` (default=1) \
|
||||
|
@ -49,6 +49,7 @@ constexpr char kInterpreterThreadsFlag[] = "num_interpreter_threads";
|
||||
constexpr char kDelegateFlag[] = "delegate";
|
||||
constexpr char kNnapiDelegate[] = "nnapi";
|
||||
constexpr char kGpuDelegate[] = "gpu";
|
||||
constexpr char kNumRanksFlag[] = "num_ranks";
|
||||
|
||||
template <typename T>
|
||||
std::vector<T> GetFirstN(const std::vector<T>& v, int n) {
|
||||
@ -144,6 +145,9 @@ class CompositeObserver : public ImagenetModelEvaluator::Observer {
|
||||
tflite::Flag::CreateFlag(kDelegateFlag, ¶ms.delegate,
|
||||
"Delegate to use for inference, if available. "
|
||||
"Must be one of {'nnapi', 'gpu'}"),
|
||||
tflite::Flag::CreateFlag(kNumRanksFlag, ¶ms.num_ranks,
|
||||
"Generates the top-1 to top-k accuracy values"
|
||||
"where k = num_ranks. Default: 10"),
|
||||
};
|
||||
tflite::Flags::Parse(&argc, const_cast<const char**>(argv), flag_list);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user