コード例 #1
0
    def check_backward(self, x_data, t_data, y_grad):
        # Skip too large case. That requires a long time.
        if self.shape[0] == 65536:
            return

        gradient_check.check_backward(
            functions.SigmoidCrossEntropy(),
            (x_data, t_data), None, atol=1e-4, rtol=1e-3)
コード例 #2
0
    def check_backward(self, x_data, t_data, use_cudnn=True):
        # Skip too large case. That requires a long time.
        if self.shape[0] == 65536:
            return

        gradient_check.check_backward(
            functions.SigmoidCrossEntropy(use_cudnn),
            (x_data, t_data), None, eps=1e-2)
コード例 #3
0
    def check_backward_no_reduction(self, x_data, t_data, y_grad):
        # Skip too large case. That requires a long time.
        if self.shape[0] == 65536:
            return

        gradient_check.check_backward(
            functions.SigmoidCrossEntropy(reduce='no'), (x_data, t_data),
            y_grad,
            eps=1e-2)