Skip to content

Commit

Permalink
Automated evaluation on KWS
Browse files Browse the repository at this point in the history
  • Loading branch information
EyubogluMerve committed Jan 4, 2024
1 parent 7e4cfe1 commit 4e78ca8
Showing 1 changed file with 7 additions and 14 deletions.
21 changes: 7 additions & 14 deletions notebooks/Automated_Evaluation_KWS.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@
" mixed_signals_loader = torch.utils.data.DataLoader(mixed_signals, batch_size = 256)\n",
"\n",
" else:\n",
" noise_dataset = msnoise.MSnoise(root = '/data_ssd', classes = [noise_kind], d_type = 'test', len = 11005,remove_unknowns=True,\n",
" noise_dataset = msnoise.MSnoise(root = '/data_ssd', classes = [noise_kind], d_type = 'test', len = 11005, remove_unknowns=True,\n",
" transform=None, quantize=False, download=False)\n",
"\n",
" mixed_signals = signalmixer(test_dataset, snr = db, noise_kind = noise_kind, noise_dataset = noise_dataset)\n",
Expand Down Expand Up @@ -337,14 +337,12 @@
" if noise == False:\n",
" db = None\n",
" noise_kind = None\n",
"\n",
" accuracies = np.zeros(1)\n",
" accuracies[0] = evaluate(db, noise, noise_kind)\n",
"\n",
" # noisy test set evaluation\n",
" else:\n",
" snr_num = calculate_snr_num(snr_list)\n",
"\n",
" # noisy test set evaluation\n",
" accuracies = np.zeros(snr_num)\n",
"\n",
" for idx, db in enumerate(snr_list):\n",
Expand Down Expand Up @@ -544,15 +542,8 @@
"\n",
" df = pd.DataFrame(csv_list, columns = ['Type', 'SNR (dB)', f'{model_files[model_name]}'])\n",
" \n",
" accs.append(df)"
]
},
{
"cell_type": "code",
"execution_count": 29,
"metadata": {},
"outputs": [],
"source": [
" accs.append(df)\n",
"\n",
"for i in accs:\n",
" df[i.columns[-1]] = i[i.columns[-1]]"
]
Expand Down Expand Up @@ -859,7 +850,9 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"You can also create CSV files using the predefined data frames. If the current model file is already in the CSV file, accuracies will not be added to the CSV file. If not, then the current accuracy results will be added to the CSV file as a new column."
"You can also create CSV files using the predefined data frames. If the current model file is already in the CSV file, accuracies will not be added to the CSV file. If not, then the current accuracy results will be added to the CSV file as a new column.\n",
"\n",
"- You have to make sure that you test the same noise kinds for same SNR levels for all of the models."
]
},
{
Expand Down

0 comments on commit 4e78ca8

Please sign in to comment.