forked from fomorians/distracted-drivers-tf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
architectures.py
40 lines (29 loc) · 990 Bytes
/
architectures.py
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
29
30
31
32
33
34
35
36
37
38
39
40
import tensorflow as tf
from layers import Dense, Conv2D, Flatten, Conv2DBatchNorm, AvgPool, Dropout, Activation
def vgg_bn():
return [
Conv2D([3, 3], 32, [1, 1, 1, 1], padding='SAME'),
Conv2DBatchNorm(32),
Activation(tf.nn.relu),
Conv2D([3, 3], 32, [1, 1, 1, 1], padding='SAME'),
Conv2DBatchNorm(32),
Activation(tf.nn.relu),
Conv2D([3, 3], 64, [1, 2, 2, 1]),
Conv2DBatchNorm(64),
Activation(tf.nn.relu),
Conv2D([3, 3], 64, [1, 1, 1, 1], padding='SAME'),
Conv2DBatchNorm(64),
Activation(tf.nn.relu),
Conv2D([3, 3], 128, [1, 2, 2, 1]),
Conv2DBatchNorm(128),
Activation(tf.nn.relu),
Conv2D([3, 3], 128, [1, 1, 1, 1], padding='SAME'),
Conv2DBatchNorm(128),
Activation(tf.nn.relu),
Flatten(),
Dense(128),
Activation(tf.sigmoid),
Dropout(0.5),
Dense(10),
Activation(tf.nn.softmax),
]