Skip to content

Instantly share code, notes, and snippets.

@kmdupr33
Created September 5, 2019 12:40
Show Gist options
  • Save kmdupr33/7df983b852854e525d5d00ceae453c50 to your computer and use it in GitHub Desktop.
Save kmdupr33/7df983b852854e525d5d00ceae453c50 to your computer and use it in GitHub Desktop.
fun findLearningParameters(videoGameData: Array<Pair<Double, Double>>): Pair<Double, Double> {
val learningRate = .0003
var guess = Pair(0.0, 0.0)
for (i in 1..10000000) {
guess = updateGuess(guess, learningRate, videoGameData)
if (i % 1000 == 0) println("Guess: $guess")
if (i % 1000 == 0) println("Cost: ${cost(videoGameData, guess)}")
}
return guess
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment