We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5479508 commit 0d2076eCopy full SHA for 0d2076e
js/main.js
@@ -153,10 +153,10 @@ function loop() {
153
tail_down: (snake.cells[0].y + grid) / canvas.height
154
},
155
output: {
156
- up: 0,
157
- down: 0,
158
- left: 0,
159
- right: 0
+ up: Math.random(),
+ down: Math.random(),
+ left: Math.random(),
+ right: Math.random()
160
}
161
})
162
@@ -167,8 +167,8 @@ function loop() {
167
// count frames
168
training_count++
169
170
- // train the network every 40 frames
171
- if (training_count === 40 || first_time) {
+ // train the network every 50 frames
+ if (training_count === 50 || first_time) {
172
first_time = false
173
network.train(trainingData)
174
training_count = 0
0 commit comments