Skip to content

Instantly share code, notes, and snippets.

@klgraham
Created April 3, 2016 22:37
Show Gist options
  • Save klgraham/024aa1ee4bbfc9d98bccbddfa0a01070 to your computer and use it in GitHub Desktop.
Save klgraham/024aa1ee4bbfc9d98bccbddfa0a01070 to your computer and use it in GitHub Desktop.
mutating func backProp(input: [Double], output: Int) {
let prediction = feedForward(input)
let error = output - prediction
for i in 0..<weights.count {
weights[i] += learningRate * Double(error) * input[i]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment