def get_distribution_function(self):
""" Return predictions and scores of shape [batch_size, time_steps, label space size].
Used at test time.
"""
scores0 = self.scores.reshape([self.x.shape[0], self.x.shape[1],
self.label_space_size]).dimshuffle(1, 0, 2)
return theano.function([self.x0, self.mask0], [self.pred0, scores0],
name='f_pred',
allow_input_downcast=True,
on_unused_input='warn',
givens=({self.is_train: numpy.cast['int8'](0)}))
评论列表
文章目录