def classify(self,x=None,train=False):
if x is None:
x=Tensor.context
image = x.value
self.x_batch = image
xp = Deel.xp
x_data = xp.asarray(self.x_batch,dtype=Deel.xp.float32)
x = chainer.Variable(x_data, volatile='off' if train else 'on')
score = self.forward(x)
score = F.softmax(score)
score = Variable(score.data) #Unchain
t = ChainerTensor(score)
t.owner=self
t.use()
return t
评论列表
文章目录