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))
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

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: HsinYingLee/DRIT
Commit Name: 7df18981f43e07e385a20ec18b820dd25e01a4b2
Time: 2018-07-28
Author: hytseng0509@gmail.com
File Name: src/networks.py
Class Name: LayerNorm
Method Name: forward


Project Name: iskandr/fancyimpute
Commit Name: e2f51920215f2c3be39de713626d1288c607eb75
Time: 2015-12-28
Author: alex.rubinsteyn@gmail.com
File Name: test/test_auto_encoder.py
Class Name:
Method Name: test_rank1_auto_encoder