Skip to content

Commit

Permalink
applications: machine_learning: Allow running ML model with no anomaly
Browse files Browse the repository at this point in the history
Change updates ML runner application module to allow running ML model
without anomaly support.

Jira: NCSDK-25938

Signed-off-by: Marek Pieta <Marek.Pieta@nordicsemi.no>
Signed-off-by: Pekka Niskanen <pekka.niskanen@nordicsemi.no>
  • Loading branch information
MarekPieta authored and nordicjm committed Mar 25, 2024
1 parent 1358035 commit f6ba792
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion applications/machine_learning/src/modules/ml_runner.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,10 @@ static void submit_result(void)

int err = ei_wrapper_get_next_classification_result(&evt->label, &evt->value, NULL);

if (!err) {
if (!err && ei_wrapper_classifier_has_anomaly()) {
err = ei_wrapper_get_anomaly(&evt->anomaly);
} else {
evt->anomaly = 0.0;
}

__ASSERT_NO_MSG(!err);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ nRF5340 Audio
nRF Machine Learning (Edge Impulse)
-----------------------------------

|no_changes_yet_note|
* Updated the ``ml_runner`` application module to allow running a machine learning model without anomaly support.

nRF Desktop
-----------
Expand Down

0 comments on commit f6ba792

Please sign in to comment.