8da4857396fcedb1abd19a08cd4de40d16c7bc50,research/audioset/yamnet/yamnet_test.py,YAMNetTest,clip_test,#YAMNetTest#,39

Before Change


        np.reshape(waveform, [1, -1]), steps=1)[0], axis=0)
      top_n_class_names = YAMNetTest._yamnet_classes[
        np.argsort(prediction)[-top_n:]]
      self.assertIn(expected_class_name, top_n_class_names)

  def testZeros(self):
    self.clip_test(
        waveform=np.zeros((1, int(3 * params.SAMPLE_RATE))),

After Change



  def clip_test(self, waveform, expected_class_name, top_n=10):
    Run the model on the waveform, check that expected class is in top-n.
    predictions, embeddings, log_mel_spectrogram = YAMNetTest._yamnet(waveform)
    clip_predictions = np.mean(predictions, axis=0)
    top_n_indices = np.argsort(clip_predictions)[-top_n:]
    top_n_scores = clip_predictions[top_n_indices]
    top_n_class_names = YAMNetTest._yamnet_classes[top_n_indices]
    top_n_predictions = list(zip(top_n_class_names, top_n_scores))
    self.assertIn(expected_class_name, top_n_class_names,
                  "Did not find expected class {} in top {} predictions: {}".format(
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 5

Non-data size: 5

Instances


Project Name: tensorflow/models
Commit Name: 8da4857396fcedb1abd19a08cd4de40d16c7bc50
Time: 2020-08-17
Author: 30733558+plakal@users.noreply.github.com
File Name: research/audioset/yamnet/yamnet_test.py
Class Name: YAMNetTest
Method Name: clip_test


Project Name: nilearn/nilearn
Commit Name: b32c8a990a744e135c8787456ef5b62ab40d6da7
Time: 2019-04-18
Author: jerome-alexis.chevalier@inria.fr
File Name: nilearn/regions/tests/test_rena_clustering.py
Class Name:
Method Name: test_rena_clustering


Project Name: comic/grand-challenge.org
Commit Name: 8bf9d4923eb3f9184280ff6f71df9794b968c9a6
Time: 2018-08-20
Author: jamesmeakin@gmail.com
File Name: app/tests/cases_tests/test_views.py
Class Name:
Method Name: test_annotation_list_filter


Project Name: keras-team/keras
Commit Name: b8ec0e6dc9bc2b069fa9cdb86b8a32ef6a10a6aa
Time: 2019-03-25
Author: me@taehoonlee.com
File Name: tests/keras/backend/backend_test.py
Class Name: TestBackend
Method Name: test_clip_supports_tensor_arguments


Project Name: jadore801120/attention-is-all-you-need-pytorch
Commit Name: bed0a0ae26451c9897cf1ee0f7302e42eba9b42c
Time: 2018-08-23
Author: yhhuang@nlg.csie.ntu.edu.tw
File Name: transformer/Models.py
Class Name:
Method Name: get_attn_subsequent_mask