88edea32e8526e13c01668aa3b00843d0ced6288,tests/estimators/classification/test_deeplearning_common.py,,test_loss_gradient_amp,#Any#Any#Any#Any#Any#,514

Before Change



    // Second test of gradients
    sub_gradients = gradients[0, 0, 14, :]
    print("sub_gradients2", sub_gradients)
    np.testing.assert_array_almost_equal(
        sub_gradients, expected_gradients_2[0], decimal=expected_gradients_2[1],
    )

After Change


    gradients = classifier.loss_gradient_framework(
        torch.tensor(x_test_mnist).to(classifier.device), torch.tensor(y_test_mnist).to(classifier.device)
    )
    gradients = gradients.cpu().numpy()

    // Test shape
    assert gradients.shape == (x_test_mnist.shape[0],) + mnist_shape

    // First test of gradients
    sub_gradients = gradients[0, 0, :, 14]

    np.testing.assert_array_almost_equal(
        sub_gradients, expected_gradients_1[0], decimal=expected_gradients_1[1],
    )
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: IBM/adversarial-robustness-toolbox
Commit Name: 88edea32e8526e13c01668aa3b00843d0ced6288
Time: 2020-09-23
Author: M.N.Tran@ibm.com
File Name: tests/estimators/classification/test_deeplearning_common.py
Class Name:
Method Name: test_loss_gradient_amp


Project Name: hunkim/PyTorchZeroToAll
Commit Name: c4610ff26a01a0622bc11dcac0f0812f05c56e0c
Time: 2017-11-02
Author: hunkim@gmail.com
File Name: 12_4_name_classify.py
Class Name: RNNClassifier
Method Name: forward


Project Name: pytorch/examples
Commit Name: 645c7c386e62d2fb1d50f4621c1a52645a13869f
Time: 2018-04-24
Author: soumith@gmail.com
File Name: time_sequence_prediction/train.py
Class Name:
Method Name: