def __init__(self, input, n_in, n_out, verbose):
self.verbose = verbose
self.W = Weight((n_in, n_out))
self.b = Weight((n_out,), std=0)
self.p_y_given_x = T.nnet.softmax(
T.dot(input, self.W.val) + self.b.val)
self.y_pred = T.argmax(self.p_y_given_x, axis=1)
self.params = [self.W.val, self.b.val]
self.weight_type = ['W', 'b']
if self.verbose:
print 'softmax layer with num_in: ' + str(n_in) + \
' num_out: ' + str(n_out)
评论列表
文章目录