2695924bd6605168cef51e9477faa1bacd3717f5,tests/unit_test/test_embedding.py,,test_embedding,#Any#,12

Before Change


    assert (np.abs(embed.embedding_mat[2] - \
                   (np.array(range(10)) * 0.1 + 0.1)) < 1e-6).all()

    embed = mz.datasets.toy.load_embedding()
    embed.build(term_index_input)
    assert embed.embedding_dim == 10
    assert embed.index_state == {4: 1, 2: 1, 3: 1, 1: 2, 0: 0}
    assert (embed.embedding_mat[0] == np.array([0] * 10)).all()
    assert (np.abs(embed.embedding_mat[2] - \

After Change


def test_embedding(term_index):
    embed = mz.embedding.load_from_file(mz.datasets.embeddings.EMBED_RANK)
    matrix = embed.build_matrix(term_index)
    assert matrix.shape == (len(term_index) + 1, 50)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 3

Instances


Project Name: NTMC-Community/MatchZoo
Commit Name: 2695924bd6605168cef51e9477faa1bacd3717f5
Time: 2018-12-07
Author: i@uduse.com
File Name: tests/unit_test/test_embedding.py
Class Name:
Method Name: test_embedding


Project Name: azavea/raster-vision
Commit Name: 99fd7236942221db5387a9e2214e7482cc2d562d
Time: 2018-08-28
Author: jmcclain@azavea.com
File Name: src/rastervision/label_stores/segmentation_raster_file.py
Class Name: SegmentationRasterFile
Method Name: __init__


Project Name: Qiskit/qiskit-aqua
Commit Name: e44bb209a41d9f85a0f115b21b3b150bff65ee66
Time: 2020-09-15
Author: jules.gacon@googlemail.com
File Name: test/aqua/test_amplitude_estimation.py
Class Name: TestBernoulli
Method Name: test_iqae_circuits


Project Name: Qiskit/qiskit-aqua
Commit Name: e44bb209a41d9f85a0f115b21b3b150bff65ee66
Time: 2020-09-15
Author: jules.gacon@googlemail.com
File Name: test/aqua/test_amplitude_estimation.py
Class Name: TestBernoulli
Method Name: test_mlae_circuits