xsnippet logotype

xsnippet

#363361, Untitled [ Python ]

by Guest
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
with tf.variable_scope('conv1') as scope:
   kernel = _variable_with_weight_decay('weights',
                                        shape=[5, 5, 3, 64],
                                        stddev=5e-2,
                                        wd=0.0)
   conv = tf.nn.conv2d(images, kernel, [1, 1, 1, 1], padding='SAME')
   biases = _variable_on_cpu('biases', [64], tf.constant_initializer(0.0))
   pre_activation = tf.nn.bias_add(conv, biases)
   conv1 = tf.nn.relu(pre_activation, name=scope.name)
   _activation_summary(conv1)



 # pool1
 pool1 = tf.nn.max_pool(conv1, ksize=[1, 3, 3, 1], strides=[1, 2, 2, 1],
                        padding='SAME', name='pool1')
 # norm1
 norm1 = tf.nn.lrn(pool1, 4, bias=1.0, alpha=0.001 / 9.0, beta=0.75,
                   name='norm1')