|
287 | 287 | "scores, embeddings, spectrogram = yamnet_model(testing_wav_data)\n",
|
288 | 288 | "class_scores = tf.reduce_mean(scores, axis=0)\n",
|
289 | 289 | "top_class = tf.argmax(class_scores)\n",
|
290 |
| - "infered_class = class_names[top_class]\n", |
| 290 | + "inferred_class = class_names[top_class]\n", |
291 | 291 | "\n",
|
292 |
| - "print(f'The main sound is: {infered_class}')\n", |
| 292 | + "print(f'The main sound is: {inferred_class}')\n", |
293 | 293 | "print(f'The embeddings shape: {embeddings.shape}')"
|
294 | 294 | ]
|
295 | 295 | },
|
|
629 | 629 | "scores, embeddings, spectrogram = yamnet_model(testing_wav_data)\n",
|
630 | 630 | "result = my_model(embeddings).numpy()\n",
|
631 | 631 | "\n",
|
632 |
| - "infered_class = my_classes[result.mean(axis=0).argmax()]\n", |
633 |
| - "print(f'The main sound is: {infered_class}')" |
| 632 | + "inferred_class = my_classes[result.mean(axis=0).argmax()]\n", |
| 633 | + "print(f'The main sound is: {inferred_class}')" |
634 | 634 | ]
|
635 | 635 | },
|
636 | 636 | {
|
|
806 | 806 | "scores, embeddings, spectrogram = yamnet_model(waveform)\n",
|
807 | 807 | "class_scores = tf.reduce_mean(scores, axis=0)\n",
|
808 | 808 | "top_class = tf.argmax(class_scores)\n",
|
809 |
| - "infered_class = class_names[top_class]\n", |
| 809 | + "inferred_class = class_names[top_class]\n", |
810 | 810 | "top_score = class_scores[top_class]\n",
|
811 |
| - "print(f'[YAMNet] The main sound is: {infered_class} ({top_score})')\n", |
| 811 | + "print(f'[YAMNet] The main sound is: {inferred_class} ({top_score})')\n", |
812 | 812 | "\n",
|
813 | 813 | "reloaded_results = reloaded_model(waveform)\n",
|
814 | 814 | "your_top_class = tf.argmax(reloaded_results)\n",
|
815 |
| - "your_infered_class = my_classes[your_top_class]\n", |
| 815 | + "your_inferred_class = my_classes[your_top_class]\n", |
816 | 816 | "class_probabilities = tf.nn.softmax(reloaded_results, axis=-1)\n",
|
817 | 817 | "your_top_score = class_probabilities[your_top_class]\n",
|
818 |
| - "print(f'[Your model] The main sound is: {your_infered_class} ({your_top_score})')" |
| 818 | + "print(f'[Your model] The main sound is: {your_inferred_class} ({your_top_score})')" |
819 | 819 | ]
|
820 | 820 | },
|
821 | 821 | {
|
|
0 commit comments