class Layer { | |
... | |
var weights: Matrix! | |
var biases: Matrix! | |
var previousLayer: Layer? | |
var nextLayer: Layer? | |
func initialize(previous: Layer?, next: Layer?) { | |
if let previous = previous { | |
weights = Matrix(random: Shape(rows: size, columns: previous.size), multiplier: 0.01) | |
biases = Matrix(zeros: Shape(rows: size, columns: 1)) | |
} | |
previousLayer = previous | |
nextLayer = next | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment