-
-
Save jknthn/e8a2bac043f327225e335cf98c24ff3e 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 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