Skip to content

Instantly share code, notes, and snippets.

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

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
You can’t perform that action at this time.