Some bugfixes and misc
linter / quality (push) Successful in 4m24s
tests / ci (8.4) (push) Successful in 4m47s
tests / ci (8.5) (push) Successful in 5m0s

This commit is contained in:
2026-09-08 20:01:52 +02:00
parent 0e177f8491
commit 69e683bcaf
13 changed files with 120 additions and 33 deletions
+7 -4
View File
@@ -1,5 +1,6 @@
<script setup lang="ts">
import { computed, ComputedRef } from 'vue';
import { computed } from 'vue';
import type { ComputedRef } from 'vue';
import type { Iteration } from '@/types/perceptron';
const props = defineProps<{
@@ -13,7 +14,9 @@ const props = defineProps<{
const allWeightPerIteration: ComputedRef<number[][]> = computed(() => {
return props.iterations.map((iteration) => {
// We flatten the weights
return iteration.weights.flat(2);
return iteration.weights
.flat(2)
.filter((weight): weight is number => weight !== null && Number.isFinite(weight));
});
});
@@ -61,10 +64,10 @@ const rowBgDark = computed(() => {
v-for="(weight, weightIndex) in allWeightPerIteration[index]"
v-bind:key="weightIndex"
>
{{ weight.toFixed(2) }}
{{ Number.isFinite(weight) ? weight.toFixed(2) : 'N/A' }}
</td>
</template>
<td>{{ iteration.error.toFixed(2) }}</td>
<td>{{ iteration.error === null ? 'N/A' : iteration.error.toFixed(2) }}</td>
</tr>
<tr