MCPcopy
hub / github.com/matthewearl/deep-anpr / convolutional_layers

Function convolutional_layers

model.py:69–99  ·  view source on GitHub ↗

Get the convolutional layers of the model.

()

Source from the content-addressed store, hash-verified

67
68
69def convolutional_layers():
70 """
71 Get the convolutional layers of the model.
72
73 """
74 x = tf.placeholder(tf.float32, [None, None, None])
75
76 # First layer
77 W_conv1 = weight_variable([5, 5, 1, 48])
78 b_conv1 = bias_variable([48])
79 x_expanded = tf.expand_dims(x, 3)
80 h_conv1 = tf.nn.relu(conv2d(x_expanded, W_conv1) + b_conv1)
81 h_pool1 = max_pool(h_conv1, ksize=(2, 2), stride=(2, 2))
82
83 # Second layer
84 W_conv2 = weight_variable([5, 5, 48, 64])
85 b_conv2 = bias_variable([64])
86
87 h_conv2 = tf.nn.relu(conv2d(h_pool1, W_conv2) + b_conv2)
88 h_pool2 = max_pool(h_conv2, ksize=(2, 1), stride=(2, 1))
89
90 # Third layer
91 W_conv3 = weight_variable([5, 5, 64, 128])
92 b_conv3 = bias_variable([128])
93
94 h_conv3 = tf.nn.relu(conv2d(h_pool2, W_conv3) + b_conv3)
95 h_pool3 = max_pool(h_conv3, ksize=(2, 2), stride=(2, 2))
96
97 return x, h_pool3, [W_conv1, b_conv1,
98 W_conv2, b_conv2,
99 W_conv3, b_conv3]
100
101
102def get_training_model():

Callers 2

get_training_modelFunction · 0.85
get_detect_modelFunction · 0.85

Calls 4

weight_variableFunction · 0.85
bias_variableFunction · 0.85
conv2dFunction · 0.85
max_poolFunction · 0.85

Tested by

no test coverage detected