Skip to content

Commit c1067e9

Browse files
committed
add Neural Network as default classifier to UI
1 parent e9527d7 commit c1067e9

File tree

9 files changed

+22
-13
lines changed

9 files changed

+22
-13
lines changed

src/ui/src/components/ModelSummary/ModelSummary.jsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import React, { useState, useEffect } from "react";
2222
import { Box, Typography } from "@mui/material";
2323
import StandardTable from "components/StandardTable";
2424
import { ColumnType } from "components/StandardTable/StandardTableConstants";
25+
import { NN_CLASSIFIER_NAME_LIST } from "consts";
2526
import NeuralNetworkSummary from "./NeuralNetworkSummary";
2627
import PMEModelSummary from "./PMEModelSummary";
2728

@@ -72,7 +73,7 @@ const ModelSummary = ({ model, showTitle }) => {
7273
m.pipeline_summary[pipelineSummaryCount - 1].optimizers[0].inputs.max_depth;
7374
} else if (m.device_configuration?.classifier === "Boosted Tree Ensemble") {
7475
//
75-
} else if (m.device_configuration?.classifier === "TensorFlow Lite for Microcontrollers") {
76+
} else if (NN_CLASSIFIER_NAME_LIST.includes(m.device_configuration?.classifier)) {
7677
//
7778
}
7879
}
@@ -131,7 +132,7 @@ const ModelSummary = ({ model, showTitle }) => {
131132
{model?.data?.device_configuration?.classifier === "PME" && modelParameters ? (
132133
<PMEModelSummary model={modelParameters} />
133134
) : null}
134-
{model?.data?.device_configuration?.classifier === "TensorFlow Lite for Microcontrollers" ? (
135+
{NN_CLASSIFIER_NAME_LIST.includes(model?.data?.device_configuration?.classifier) ? (
135136
<NeuralNetworkSummary model={model} />
136137
) : null}
137138
</Box>

src/ui/src/components/PipelineCreateForm/PipelineCreateForm.jsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ License along with SensiML Piccolo AI. If not, see <https://www.gnu.org/licenses
2020
import React, { useState } from "react";
2121
import { Box, Stepper, Step, StepLabel } from "@mui/material";
2222
import { useTranslation } from "react-i18next";
23+
import { DEFAULT_CLASSIFIER } from "consts";
2324

2425
import PipelineQueryCreateForm from "components/PipelineQueryCreateForm";
2526

@@ -75,7 +76,11 @@ const PipelineCreateForm = ({
7576
))}
7677
</Stepper>
7778
{activeStep === STEP_PARAMS ? (
78-
<PipelineCreateFormParameters classifiers={classifiers} onSubmit={handleSubmitParams} />
79+
<PipelineCreateFormParameters
80+
classifiers={classifiers}
81+
defaultClassifier={DEFAULT_CLASSIFIER}
82+
onSubmit={handleSubmitParams}
83+
/>
7984
) : (
8085
<PipelineQueryCreateForm
8186
pipelineError={pipelineError}

src/ui/src/consts/CLASSIFIERS.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export const NN_CLASSIFIER_NAME_LIST = ["TensorFlow Lite for Microcontrollers", "Neural Network"];
2+
export const DISABLED_CLASSIFIERS = ["TF Micro", "TensorFlow Lite for Microcontrollers"];
3+
export const DEFAULT_CLASSIFIER = "Neural Network";

src/ui/src/consts/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import CONSOLE from "./CONSOLE";
2424
import RESPONSIVE from "./RESPONSIVE";
2525
import PIPELINE_CONSTS from "./PIPELINE_CONSTS";
2626

27+
export * from "./CLASSIFIERS";
2728
export * from "./CHARTS_TYPES";
2829

2930
export {

src/ui/src/containers/DownloadModel/components/TargetDeviceOptions.jsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ import Autocomplete from "@mui/material/Autocomplete";
4141
import FormCurtain from "components/UIFormCurtain";
4242
import CheckBoxSelectCard from "components/FormElements/CheckBoxSelectCard";
4343

44+
import { NN_CLASSIFIER_NAME_LIST } from "consts";
4445
import {
4546
PLATROFM_TYPES,
4647
STEP_SELECT_PLATFORM,
@@ -56,8 +57,6 @@ import useStyles from "../DownloadModelStyles";
5657
import AdvanceSettings from "./AdvanceSettings";
5758
import defaultSelectedPlatform from "./defaultSelectedPlatform";
5859

59-
const TF_CLASSIFIER_NAME = "TensorFlow Lite for Microcontrollers";
60-
6160
/*
6261
const defaultEmpty = {
6362
target_platform: "",
@@ -180,7 +179,7 @@ const TargetDeviceOptions = forwardRef(
180179
),
181180
target_compiler: platform?.default_selections?.compiler || "",
182181
};
183-
if (platform?.nn_inference_engines && classifierName === TF_CLASSIFIER_NAME) {
182+
if (platform?.nn_inference_engines && NN_CLASSIFIER_NAME_LIST.includes(classifierName)) {
184183
const nnList = _.keys(platform.nn_inference_engines);
185184
if (!_.isEmpty(nnList)) {
186185
// eslint-disable-next-line prefer-destructuring

src/ui/src/store/autoML/const.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ export const TVO_LIST = [
8787
PIPELINE_STEP_TYPES.VALIDATION,
8888
];
8989

90-
export const DISABLED_CLASSIFIERS = ["TF Micro"];
90+
export const DISABLED_CLASSIFIERS = ["TF Micro", "TensorFlow Lite for Microcontrollers"];
9191

9292
export const ONETIME_ADDED = [FEATURE_GENERATOR, FEATURE_SELECTOR];
9393

src/ui/src/store/pipelineTemplates/data/KWSpottingData.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@
123123
],
124124
"classifiers": [
125125
{
126-
"name": "TensorFlow Lite for Microcontrollers",
126+
"name": "Neural Network",
127127
"inputs": {}
128128
}
129129
],
@@ -296,7 +296,7 @@
296296
],
297297
"classifiers": [
298298
{
299-
"name": "TensorFlow Lite for Microcontrollers",
299+
"name": "Neural Network",
300300
"inputs": {}
301301
}
302302
],
@@ -501,7 +501,7 @@
501501
],
502502
"classifiers": [
503503
{
504-
"name": "TensorFlow Lite for Microcontrollers",
504+
"name": "Neural Network",
505505
"inputs": {}
506506
}
507507
],
@@ -659,7 +659,7 @@
659659
],
660660
"classifiers": [
661661
{
662-
"name": "TensorFlow Lite for Microcontrollers",
662+
"name": "Neural Network",
663663
"inputs": {}
664664
}
665665
],

src/ui/src/store/pipelineTemplates/data/audioData.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@
168168
],
169169
"classifiers": [
170170
{
171-
"name": "TensorFlow Lite for Microcontrollers",
171+
"name": "Neural Network",
172172
"inputs": {}
173173
}
174174
],

src/ui/src/store/transforms/selectors.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ You should have received a copy of the GNU Affero General Public
1717
License along with SensiML Piccolo AI. If not, see <https://www.gnu.org/licenses/>.
1818
*/
1919

20-
import { DISABLED_CLASSIFIERS } from "store/autoML/const";
20+
import { DISABLED_CLASSIFIERS } from "consts";
2121

2222
export const selectTransformsByTypeSubType =
2323
(type, subtype, transformList, excludeTransform) => (state) => {

0 commit comments

Comments
 (0)