Light mode support
This commit is contained in:
@@ -46,7 +46,7 @@ const rowBgDark = computed(() => {
|
|||||||
v-for="(iteration, index) in props.iterations"
|
v-for="(iteration, index) in props.iterations"
|
||||||
v-bind:key="index"
|
v-bind:key="index"
|
||||||
:class="{
|
:class="{
|
||||||
'bg-gray-900': rowBgDark[index],
|
'bg-gray-300 dark:bg-gray-900': rowBgDark[index],
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
<td>{{ iteration.epoch }}</td>
|
<td>{{ iteration.epoch }}</td>
|
||||||
@@ -60,7 +60,7 @@ const rowBgDark = computed(() => {
|
|||||||
<td>{{ iteration.error.toFixed(2) }}</td>
|
<td>{{ iteration.error.toFixed(2) }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr v-if="props.trainingEnded" class="bg-red-900 text-center">
|
<tr v-if="props.trainingEnded" class="bg-red-400 dark:bg-red-900 text-center">
|
||||||
<td colspan="100%">
|
<td colspan="100%">
|
||||||
<strong>Entraînement terminé :</strong>
|
<strong>Entraînement terminé :</strong>
|
||||||
{{ props.trainingEndReason }}
|
{{ props.trainingEndReason }}
|
||||||
|
|||||||
@@ -20,14 +20,18 @@ const farLeftDataPointX = computed(() => {
|
|||||||
if (props.cleanedDataset.length === 0) {
|
if (props.cleanedDataset.length === 0) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
const minX = Math.min(...props.cleanedDataset.flatMap((d) => d.data.map((point) => point.x)));
|
const minX = Math.min(
|
||||||
|
...props.cleanedDataset.flatMap((d) => d.data.map((point) => point.x)),
|
||||||
|
);
|
||||||
return minX;
|
return minX;
|
||||||
});
|
});
|
||||||
const farRightDataPointX = computed(() => {
|
const farRightDataPointX = computed(() => {
|
||||||
if (props.cleanedDataset.length === 0) {
|
if (props.cleanedDataset.length === 0) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
const maxX = Math.max(...props.cleanedDataset.flatMap((d) => d.data.map((point) => point.x)));
|
const maxX = Math.max(
|
||||||
|
...props.cleanedDataset.flatMap((d) => d.data.map((point) => point.x)),
|
||||||
|
);
|
||||||
return maxX;
|
return maxX;
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -45,7 +49,8 @@ function getPerceptronDecisionBoundaryDataset(
|
|||||||
networkWeights.length == 1 &&
|
networkWeights.length == 1 &&
|
||||||
networkWeights[0].length == 1 &&
|
networkWeights[0].length == 1 &&
|
||||||
networkWeights[0][0].length == 3
|
networkWeights[0][0].length == 3
|
||||||
) { // Unique, 3 weights perceptron
|
) {
|
||||||
|
// Unique, 3 weights perceptron
|
||||||
const perceptronWeights = networkWeights[0][0]; // We take the unique perceptron
|
const perceptronWeights = networkWeights[0][0]; // We take the unique perceptron
|
||||||
|
|
||||||
function perceptronLine(x: number): number {
|
function perceptronLine(x: number): number {
|
||||||
@@ -132,7 +137,7 @@ function getPerceptronDecisionBoundaryDataset(
|
|||||||
<template>
|
<template>
|
||||||
<Chart
|
<Chart
|
||||||
v-if="props.cleanedDataset.length > 0 || props.iterations.length > 0"
|
v-if="props.cleanedDataset.length > 0 || props.iterations.length > 0"
|
||||||
class="flex"
|
class="flex bg-primary dark:bg-transparent!"
|
||||||
:options="{
|
:options="{
|
||||||
responsive: true,
|
responsive: true,
|
||||||
maintainAspectRatio: true,
|
maintainAspectRatio: true,
|
||||||
@@ -189,8 +194,7 @@ function getPerceptronDecisionBoundaryDataset(
|
|||||||
type: 'scatter',
|
type: 'scatter',
|
||||||
label: `Label ${dataset.label}`,
|
label: `Label ${dataset.label}`,
|
||||||
data: dataset.data,
|
data: dataset.data,
|
||||||
backgroundColor:
|
backgroundColor: colors[index] || '#AAA',
|
||||||
colors[index] || '#AAA',
|
|
||||||
})),
|
})),
|
||||||
|
|
||||||
// Perceptron decision boundary
|
// Perceptron decision boundary
|
||||||
|
|||||||
@@ -5,11 +5,14 @@ import { Bar } from 'vue-chartjs';
|
|||||||
import { colors, gridColor, gridColorBold } from '@/types/graphs';
|
import { colors, gridColor, gridColorBold } from '@/types/graphs';
|
||||||
import type { Iteration } from '@/types/perceptron';
|
import type { Iteration } from '@/types/perceptron';
|
||||||
import Toggle from './ui/toggle/Toggle.vue';
|
import Toggle from './ui/toggle/Toggle.vue';
|
||||||
|
import { usePage } from '@inertiajs/vue3';
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
iterations: Iteration[];
|
iterations: Iteration[];
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
|
const page = usePage();
|
||||||
|
|
||||||
const epochErrorOnly = ref<boolean>(false);
|
const epochErrorOnly = ref<boolean>(false);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -84,7 +87,7 @@ const datasets = computed<
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<Bar
|
<Bar
|
||||||
class="flex"
|
class="bg-primary dark:bg-transparent!"
|
||||||
:options="{
|
:options="{
|
||||||
responsive: true,
|
responsive: true,
|
||||||
maintainAspectRatio: true,
|
maintainAspectRatio: true,
|
||||||
|
|||||||
Reference in New Issue
Block a user