b95fcf7f52aca8ad0b1afb3cfc64c8eed534fafe,tests/keras/backend/backend_test.py,TestBackend,test_nn_operations,#TestBackend#,783

Before Change


        check_single_tensor_operation("l2_normalize", (4, 3), BACKENDS, axis=1)

        // Test invalid use cases
        for x, k in zip(x_list, [KTH, KTF]):
            with pytest.raises(ValueError):
                z = k.dropout(x, level=-0.5)

    def test_in_top_k(self):
        batch_size = 20
        num_classes = 10

After Change


        // due to the algo difference, we can"t guarantee CNTK has the same result on the garbage input.
        // so create a seperate test case for valid lable input
        check_two_tensor_operation("categorical_crossentropy", (4, 2), (4, 2), [KTH, KTF], from_logits=True)
        xval = np.asarray([[0.26157712, 0.0432167], [-0.43380741, 0.30559841],
                           [0.20225059, -0.38956559], [-0.13805378, 0.08506755]], dtype=np.float32)
        yval = np.asarray([[0.46221867, 0.53778133], [0.51228984, 0.48771016],
                           [0.64916514, 0.35083486], [0.47028078, 0.52971922]], dtype=np.float32)
        check_two_tensor_operation("categorical_crossentropy", xval, yval,
                                   BACKENDS, cntk_two_dynamicity=True, from_logits=True)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: keras-team/keras
Commit Name: b95fcf7f52aca8ad0b1afb3cfc64c8eed534fafe
Time: 2017-07-29
Author: me@taehoonlee.com
File Name: tests/keras/backend/backend_test.py
Class Name: TestBackend
Method Name: test_nn_operations


Project Name: dpressel/mead-baseline
Commit Name: 78eba7b3f82b8420deac3cd28318dbfead0f9b9e
Time: 2018-10-30
Author: dpressel@gmail.com
File Name: python/baseline/dy/seq2seq/model.py
Class Name: Seq2SeqModel
Method Name: decode


Project Name: dmlc/dgl
Commit Name: 6f4898a128ebc5227e312640508629b50b32571b
Time: 2018-12-02
Author: yma@yma.io
File Name: examples/mxnet/gcn/gcn_batch.py
Class Name: GCN
Method Name: forward