File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -135,8 +135,8 @@ function loop() {
135135 } else {
136136
137137 // random number between 0 and 1
138- // if the random number is less than 0.4 , add the input to the training data
139- if ( Math . random ( ) < 0.4 ) {
138+ // if the random number is less than 0.35 , add the input to the training data
139+ if ( Math . random ( ) < 0.35 ) {
140140 trainingData . push ( {
141141 input : {
142142 apple_x : apple . x / canvas . width ,
@@ -167,10 +167,11 @@ function loop() {
167167 // count frames
168168 training_count ++
169169
170- // train the network every 50 frames
171- if ( training_count === 50 || first_time ) {
170+ // train the network every 25 frames
171+ if ( training_count === 25 || first_time ) {
172172 first_time = false
173173 network . train ( trainingData )
174+ console . log ( `trainingData: ${ trainingData . length } ` )
174175 training_count = 0
175176 }
176177
You can’t perform that action at this time.
0 commit comments