mirror of
https://github.com/ValentinDuflot/perceptron-visuel.git
synced 2026-01-25 23:40:38 +00:00
<Feat> shuffle du jeu à chaque époque
This commit is contained in:
parent
72f26f07b0
commit
cb0621f18c
1 changed files with 5 additions and 2 deletions
|
|
@ -901,7 +901,10 @@
|
||||||
let totalErr = 0;
|
let totalErr = 0;
|
||||||
|
|
||||||
// passe sur tous les chiffres
|
// 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 x = chiffres[idx];
|
||||||
const y = (Math.floor(idx / 10) === desiredDigit) ? 1 : 0;
|
const y = (Math.floor(idx / 10) === desiredDigit) ? 1 : 0;
|
||||||
const s = predictSum(x);
|
const s = predictSum(x);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue