Skip to content

Instantly share code, notes, and snippets.

@jknthn jknthn/nnInit.swift
Created Sep 26, 2017

Embed
What would you like to do?
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
You can’t perform that action at this time.