Some bugfixes and misc
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user