mirror of
https://github.com/ValentinDuflot/perceptron-visuel.git
synced 2026-01-25 15:34:11 +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
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue