Multilayer neuron network
This commit is contained in:
@@ -6,6 +6,7 @@ const props = defineProps<{
|
||||
iterations: Iteration[];
|
||||
trainingEnded: boolean;
|
||||
trainingEndReason: string;
|
||||
maxDisplayedWeights: number;
|
||||
}>();
|
||||
|
||||
// All weight in a simple array
|
||||
@@ -16,6 +17,12 @@ const allWeightPerIteration: ComputedRef<number[][]> = computed(() => {
|
||||
});
|
||||
});
|
||||
|
||||
const displayedWeights = computed(() => {
|
||||
const weights = allWeightPerIteration.value.find((weights) => weights.length > 0) || [];
|
||||
|
||||
return weights.length <= props.maxDisplayedWeights ? weights : [];
|
||||
});
|
||||
|
||||
const rowBgDark = computed(() => {
|
||||
let isEven = false;
|
||||
return props.iterations.map((iteration, index, arr) => {
|
||||
@@ -33,7 +40,7 @@ const rowBgDark = computed(() => {
|
||||
<th>Époch</th>
|
||||
<th>Exemple</th>
|
||||
<th
|
||||
v-for="(weight, index) in allWeightPerIteration[0]"
|
||||
v-for="(weight, index) in displayedWeights"
|
||||
v-bind:key="index"
|
||||
>
|
||||
X<sub>{{ index }}</sub>
|
||||
@@ -49,12 +56,14 @@ const rowBgDark = computed(() => {
|
||||
>
|
||||
<td>{{ iteration.epoch }}</td>
|
||||
<td>{{ iteration.exampleIndex }}</td>
|
||||
<td
|
||||
v-for="(weight, index) in allWeightPerIteration[index]"
|
||||
v-bind:key="index"
|
||||
>
|
||||
{{ weight.toFixed(2) }}
|
||||
</td>
|
||||
<template v-if="displayedWeights.length > 0">
|
||||
<td
|
||||
v-for="(weight, weightIndex) in allWeightPerIteration[index]"
|
||||
v-bind:key="weightIndex"
|
||||
>
|
||||
{{ weight.toFixed(2) }}
|
||||
</td>
|
||||
</template>
|
||||
<td>{{ iteration.error.toFixed(2) }}</td>
|
||||
</tr>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user