Last active
April 3, 2016 23:50
-
-
Save klgraham/bb9d541e5ff63c4d47035e6ed91e1494 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct PerceptronTrainer { | |
let data: [PerceptronDataPair] | |
func train(inout p: Perceptron) -> Int { | |
var error: Int = 0 | |
for d in data { | |
error = p.backProp(d.input, output: d.output) | |
} | |
return error | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct PerceptronDataPair { | |
let input: [Double] | |
let output: Int | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment