Skip to content

Instantly share code, notes, and snippets.

@saeta
Last active July 24, 2019 03:59
Show Gist options
  • Save saeta/5eb757a598b9f74616b0e5a8d87c6d84 to your computer and use it in GitHub Desktop.
Save saeta/5eb757a598b9f74616b0e5a8d87c6d84 to your computer and use it in GitHub Desktop.
Brennan's TOP SECRET Demo Notes - TFDevSummit 19
var w, b1, b2: Tensor<Float>
init(inputSize: Int, outputSize: Int) {
// Slightly buggy!
w = Tensor<Float>(zeros: [inputSize, outputSize])
b1 = Tensor<Float>(zeros: [outputSize])
b2 = Tensor<Float>(zeros: [outputSize])
}
@differentiable
func callAsFunction(_ input: Tensor<Float>) -> Tensor<Float> {
return matmul(input, w) + b1 + b2
}
@saeta
Copy link
Author

saeta commented Mar 6, 2019

See the rest of the demos at: https://github.com/saeta/s4tf-dev-summit-19

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment