Created
September 26, 2017 11:36
-
-
Save jknthn/5ad23185ff49f362b9d4fc83ab582ad3 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
class DeepNeuralNetwork { | |
let iterations: Int | |
let learningRate: Double | |
private var layers = [Layer]() | |
init(iterations: Int, learningRate: Double) { | |
self.iterations = iterations | |
self.learningRate = learningRate | |
} | |
func add(layer: Layer) { | |
layers.append(layer) | |
} | |
func compile() { | |
for i in 0..<layers.count { | |
layers[i].initialize( | |
previous: i == 0 ? nil : layers[i - 1], | |
next: i == layers.count - 1 ? nil : layers[i + 1] | |
) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment