From 382dc119f15600e1e7b098bcfbe8f114d465c324 Mon Sep 17 00:00:00 2001 From: r59q Date: Tue, 9 Jul 2024 21:22:57 +0200 Subject: [PATCH 1/2] Disabled training page tabs when knn model is disabled --- .../training/KnnModelTrainingPageView.svelte | 2 +- .../training/TrainingPageModelView.svelte | 7 +- src/pages/training/TrainingPageTabs.svelte | 69 +++++++++++++------ src/script/utils/graphUtils.ts | 5 +- 4 files changed, 56 insertions(+), 27 deletions(-) diff --git a/src/pages/training/KnnModelTrainingPageView.svelte b/src/pages/training/KnnModelTrainingPageView.svelte index 9fd3dd543..18d1b2f27 100644 --- a/src/pages/training/KnnModelTrainingPageView.svelte +++ b/src/pages/training/KnnModelTrainingPageView.svelte @@ -61,7 +61,7 @@ {#if $filters.length == 2} {:else} -
+

{$t('menu.trainer.knn.onlyTwoFilters')}

diff --git a/src/pages/training/TrainingPageModelView.svelte b/src/pages/training/TrainingPageModelView.svelte index c92f0d616..bdb8ba2a8 100644 --- a/src/pages/training/TrainingPageModelView.svelte +++ b/src/pages/training/TrainingPageModelView.svelte @@ -10,11 +10,16 @@ import KnnModelTrainingPageView from './KnnModelTrainingPageView.svelte'; import ModelRegistry from '../../script/domain/ModelRegistry'; import NeuralNetworkTrainingPageView from './NeuralNetworkTrainingPageView.svelte'; + import { Feature, hasFeature } from '../../script/FeatureToggles'; + + const showFilterList = hasFeature(Feature.KNN_MODEL);
- + {#if showFilterList} + + {/if} {#if $selectedModel.id === ModelRegistry.KNN.id} {:else if $selectedModel.id === ModelRegistry.NeuralNetwork.id} diff --git a/src/pages/training/TrainingPageTabs.svelte b/src/pages/training/TrainingPageTabs.svelte index 3c82fdd97..97e2d4709 100644 --- a/src/pages/training/TrainingPageTabs.svelte +++ b/src/pages/training/TrainingPageTabs.svelte @@ -4,9 +4,18 @@ SPDX-License-Identifier: MIT --> - -
- -
-

Neural Network

-
- -
-

KNN Model

+{#if showTabBar} + +
+ +
+

Neural Network

+
+ +
+

KNN Model

+
-
- + +{:else} + +
+ { + navigate(Paths.FILTERS); + }}> + {$t('content.trainer.controlbar.filters')} + + +{/if} diff --git a/src/script/utils/graphUtils.ts b/src/script/utils/graphUtils.ts index 9bb805a8d..85a78eaac 100644 --- a/src/script/utils/graphUtils.ts +++ b/src/script/utils/graphUtils.ts @@ -124,7 +124,4 @@ export const distanceBetween = (point1: Point3D, point2: Point3D): number => { return Math.sqrt(squaredDistance); }; -export type LossTrainingIteration = { - loss: number; - epoch: number; -}; + From cf4d8bfa1976a5bffbec86b6f7320c8bae703428 Mon Sep 17 00:00:00 2001 From: r59q Date: Tue, 9 Jul 2024 21:26:09 +0200 Subject: [PATCH 2/2] Prettier --- src/script/utils/graphUtils.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/script/utils/graphUtils.ts b/src/script/utils/graphUtils.ts index 85a78eaac..80105acb6 100644 --- a/src/script/utils/graphUtils.ts +++ b/src/script/utils/graphUtils.ts @@ -123,5 +123,3 @@ export const distanceBetween = (point1: Point3D, point2: Point3D): number => { return Math.sqrt(squaredDistance); }; - -