def inference(images, num_classes):
""" Build a time reading model for *either* hours or minutes.
Args:
images: Images returned from distorted_inputs() or inputs().
num_classes: 12 for hours, 60 for minutes.
Returns:
Logits.
"""
local4 = _inference_shared(images)
dim = num_classes
# softmax, i.e. softmax(WX + b)
with tf.variable_scope('softmax_linear') as scope:
weights = _variable_with_weight_decay('weights', [192, dim],
stddev=1 / 192.0, wd=0.0)
biases = _variable_on_cpu('biases', [dim],
tf.constant_initializer(0.0))
softmax_linear = tf.add(tf.matmul(local4, weights), biases,
name=scope.name)
_activation_summary(softmax_linear)
return softmax_linear
评论列表
文章目录