Instantly share code, notes, and snippets.

Embed
What would you like to do?
class Layer {
var A: Matrix!
var Z: Matrix!
...
func forward(X: Matrix) -> Matrix {
if activation != .none {
Z = weights.dot(X) + biases
A = activation.forward(Z)
} else {
A = X
}
return A
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment