Added Limited Epoch Event Buffer

for better frontend performance when using big  max epoch number
This commit is contained in:
2026-03-21 09:42:05 +01:00
parent f0e7be4476
commit 6abb417430
10 changed files with 149 additions and 22 deletions

View File

@@ -15,14 +15,29 @@ const allWeightPerIteration: ComputedRef<number[][]> = computed(() => {
return iteration.weights.flat(2);
});
});
const rowBgDark = computed(() => {
let isEven = false;
return props.iterations.map((iteration, index, arr) => {
if (index > 0 && arr[index - 1].epoch !== iteration.epoch) {
isEven = !isEven;
}
return isEven;
});
});
</script>
<template>
<table class="table w-full border-collapse border border-gray-300">
<tr class="text-left" v-if="props.iterations.length > 0">
<th>Itération</th>
<th>Époch</th>
<th>Exemple</th>
<th v-for="(weight, index) in allWeightPerIteration[allWeightPerIteration.length - 1]" v-bind:key="index">
<th
v-for="(weight, index) in allWeightPerIteration[
allWeightPerIteration.length - 1
]"
v-bind:key="index"
>
X<sub>{{ index }}</sub>
</th>
<th>Erreur</th>
@@ -31,12 +46,15 @@ const allWeightPerIteration: ComputedRef<number[][]> = computed(() => {
v-for="(iteration, index) in props.iterations"
v-bind:key="index"
:class="{
'bg-gray-900': iteration.iteration % 2 === 0,
'bg-gray-900': rowBgDark[index],
}"
>
<td>{{ iteration.iteration }}</td>
<td>{{ iteration.epoch }}</td>
<td>{{ iteration.exampleIndex }}</td>
<td v-for="(weight, index) in allWeightPerIteration[index]" v-bind:key="index">
<td
v-for="(weight, index) in allWeightPerIteration[index]"
v-bind:key="index"
>
{{ weight.toFixed(2) }}
</td>
<td>{{ iteration.error.toFixed(2) }}</td>