Skip to content

Instantly share code, notes, and snippets.

@mohdsanadzakirizvi
Created October 16, 2019 06:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mohdsanadzakirizvi/de3198eb51fb8dca7552a325cc79651f to your computer and use it in GitHub Desktop.
Save mohdsanadzakirizvi/de3198eb51fb8dca7552a325cc79651f to your computer and use it in GitHub Desktop.
import TensorFlow
let epochCount = 100
let batchSize = 128
// The LeNet-5 model
var classifier = Sequential {
Conv2D<Float>(filterShape: (5, 5, 1, 6), padding: .same, activation: relu)
AvgPool2D<Float>(poolSize: (2, 2), strides: (2, 2))
Conv2D<Float>(filterShape: (5, 5, 6, 16), activation: relu)
AvgPool2D<Float>(poolSize: (2, 2), strides: (2, 2))
Flatten<Float>()
Dense<Float>(inputSize: 400, outputSize: 120, activation: relu)
Dense<Float>(inputSize: 120, outputSize: 84, activation: relu)
Dense<Float>(inputSize: 84, outputSize: 10, activation: softmax)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment