diff --git a/index.html b/index.html
index af395f4..ddaf386 100644
--- a/index.html
+++ b/index.html
@@ -678,7 +678,7 @@
const targetDigitSelect = document.getElementById('targetDigit');
const lrLabel = document.getElementById('learningRateLabel');
- let learningRate = 0.5;
+ let learningRate = 0.5;
let desiredDigit = parseInt(targetDigitSelect.value);
@@ -901,7 +901,10 @@
let totalErr = 0;
// passe sur tous les chiffres
- for (let idx = 0; idx < chiffres.length; idx++) {
+ const indices = [...Array(chiffres.length).keys()];
+ indices.sort(() => Math.random() - 0.5);
+
+ for (const idx of indices) {
const x = chiffres[idx];
const y = (Math.floor(idx / 10) === desiredDigit) ? 1 : 0;
const s = predictSum(x);