-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodels.py
More file actions
28 lines (23 loc) · 800 Bytes
/
models.py
File metadata and controls
28 lines (23 loc) · 800 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import tensorflow as tf
from tensorflow import keras
## MNIST models
def build_model_simple():
return keras.Sequential([
keras.layers.Flatten(input_shape=(28, 28, 1)),
keras.layers.Dense(128, activation='relu'),
keras.layers.Dense(10, activation='softmax')
])
def build_model_simple2():
return keras.Sequential([
keras.layers.Conv2D(16, (3, 3), input_shape=(28, 28, 1)),
keras.layers.ReLU(max_value=6),
keras.layers.Flatten(),
keras.layers.Dense(256),
keras.layers.ReLU(max_value=6),
keras.layers.Dense(10, activation='softmax')
])
## Put models in the dict below to make them available to the training scripts.
models = {
'mnist_simple1': build_model_simple,
'mnist_simple2': build_model_simple2
}