def imagenet(self, image_feat, reuse=False):
with tf.variable_scope('image_net', reuse=reuse) as scope:
wd = tf.contrib.layers.l2_regularizer(self.weight_decay)
image_fc1 = tf.contrib.layers.fully_connected(image_feat,4096, weights_regularizer=wd,scope='i_fc1')
image_fc2 = tf.contrib.layers.fully_connected(image_fc1, self.num_class, activation_fn=None,weights_regularizer=wd, scope='i_fc2')
prob = tf.reduce_mean(image_fc2,axis=1)#1-tf.reduce_prod(1-image_fc2,axis=1)
self.endpoint['image_fc1'] = image_fc1
self.endpoint['image_fc2'] = image_fc2
self.endpoint['prob'] = prob
return prob
评论列表
文章目录