def forward_gpu(self, inputs):
x = inputs[0]
if (cuda.cudnn_enabled and self.use_cudnn and
(_cudnn_version >= 3000 or x.dtype != numpy.float16)):
self.y = cuda.cupy.cudnn.activation_forward(x, _mode)
else:
self.y = cuda.elementwise(
'T x', 'T y', 'y = 1 / (1 + exp(-x))',
'sigmoid_fwd')(x)
return self.y,
评论列表
文章目录