Created
October 16, 2019 06:22
-
-
Save mohdsanadzakirizvi/de3198eb51fb8dca7552a325cc79651f 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
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