Skip to content

Instantly share code, notes, and snippets.

@deleteman
Created January 7, 2023 08:28
Show Gist options
  • Save deleteman/99cb7e3fb10b7a563bdc40bec9698c69 to your computer and use it in GitHub Desktop.
Save deleteman/99cb7e3fb10b7a563bdc40bec9698c69 to your computer and use it in GitHub Desktop.
const learningRate = .3;
let image = [
0,0,0,0,0,0,0,1,
0,0,0,0,0,0,1,0,
0,0,1,1,1,1,0,0,
0,0,1,1,1,1,0,0,
0,0,1,1,1,1,0,0,
0,0,0,0,0,0,0,0,
]
for (let i = 0; i < 30000; i++) { //training
for(let x = 0; x < 8; x++) {
for(let y = 0; y < 6; y++) {
myNetwork.activate([x,y]);
myNetwork.propagate(learningRate, [image[ y * 8 + x]]);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment