Skip to content

Commit

Permalink
Updated notebooks.
Browse files Browse the repository at this point in the history
  • Loading branch information
zond committed Apr 17, 2024
1 parent c2e8d3f commit 335c491
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 93 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -201,13 +201,13 @@ add_test(NAME zimtohrli_python_test
add_test(NAME zimtohrli_ipynb_test
COMMAND sh -c "${Python3_EXECUTABLE} -m venv ${python3_VENV_DIR} &&
${python3_VENV} -m pip install jax jaxlib numpy scipy jupyter nbconvert matplotlib &&
${python3_VENV_DIR}/bin/jupyter nbconvert --to notebook --execute ${CMAKE_CURRENT_SOURCE_DIR}/zimtohrli.ipynb --inplace"
${python3_VENV_DIR}/bin/jupyter nbconvert --to notebook --execute ${CMAKE_CURRENT_SOURCE_DIR}/zimtohrli.ipynb --stdout"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
add_test(NAME zimtohrli_loudness_computation_ipynb_test
COMMAND sh -c "${Python3_EXECUTABLE} -m venv ${python3_VENV_DIR} &&
${python3_VENV} -m pip install jax jaxlib numpy scipy jupyter nbconvert pandas matplotlib &&
${python3_VENV_DIR}/bin/jupyter nbconvert --to notebook --execute ${CMAKE_CURRENT_SOURCE_DIR}/python/loudness_parameter_computation.ipynb --inplace"
${python3_VENV_DIR}/bin/jupyter nbconvert --to notebook --execute ${CMAKE_CURRENT_SOURCE_DIR}/python/loudness_parameter_computation.ipynb --stdout"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ audio (and video containing audio) compression, and also be able to plug in the
resulting psychoacoustic similarity measure into audio related machine learning
models.

For more details about how Zimtohrli works, see zimtohrli.ipynb.
For more details about how Zimtohrli works, see [zimtohrli.ipynb](zimtohrli.ipynb).

## Compatibility

Expand Down
56 changes: 28 additions & 28 deletions python/loudness_parameter_computation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
"execution_count": 1,
"metadata": {
"execution": {
"iopub.execute_input": "2024-04-17T11:26:35.100410Z",
"iopub.status.busy": "2024-04-17T11:26:35.099824Z",
"iopub.status.idle": "2024-04-17T11:26:35.746823Z",
"shell.execute_reply": "2024-04-17T11:26:35.746017Z"
"iopub.execute_input": "2024-04-17T11:55:47.280334Z",
"iopub.status.busy": "2024-04-17T11:55:47.279648Z",
"iopub.status.idle": "2024-04-17T11:55:47.775725Z",
"shell.execute_reply": "2024-04-17T11:55:47.775151Z"
},
"executionInfo": {
"elapsed": 59,
Expand Down Expand Up @@ -57,10 +57,10 @@
"execution_count": 2,
"metadata": {
"execution": {
"iopub.execute_input": "2024-04-17T11:26:35.749283Z",
"iopub.status.busy": "2024-04-17T11:26:35.749034Z",
"iopub.status.idle": "2024-04-17T11:26:35.791354Z",
"shell.execute_reply": "2024-04-17T11:26:35.790798Z"
"iopub.execute_input": "2024-04-17T11:55:47.777713Z",
"iopub.status.busy": "2024-04-17T11:55:47.777520Z",
"iopub.status.idle": "2024-04-17T11:55:47.809498Z",
"shell.execute_reply": "2024-04-17T11:55:47.808954Z"
},
"executionInfo": {
"elapsed": 55,
Expand Down Expand Up @@ -115,10 +115,10 @@
"execution_count": 3,
"metadata": {
"execution": {
"iopub.execute_input": "2024-04-17T11:26:35.793200Z",
"iopub.status.busy": "2024-04-17T11:26:35.793008Z",
"iopub.status.idle": "2024-04-17T11:26:35.798134Z",
"shell.execute_reply": "2024-04-17T11:26:35.797682Z"
"iopub.execute_input": "2024-04-17T11:55:47.811240Z",
"iopub.status.busy": "2024-04-17T11:55:47.811105Z",
"iopub.status.idle": "2024-04-17T11:55:47.814377Z",
"shell.execute_reply": "2024-04-17T11:55:47.814064Z"
},
"executionInfo": {
"elapsed": 52,
Expand Down Expand Up @@ -155,10 +155,10 @@
"height": 1000
},
"execution": {
"iopub.execute_input": "2024-04-17T11:26:35.800483Z",
"iopub.status.busy": "2024-04-17T11:26:35.800181Z",
"iopub.status.idle": "2024-04-17T11:26:39.141751Z",
"shell.execute_reply": "2024-04-17T11:26:39.141180Z"
"iopub.execute_input": "2024-04-17T11:55:47.816042Z",
"iopub.status.busy": "2024-04-17T11:55:47.815914Z",
"iopub.status.idle": "2024-04-17T11:55:50.874431Z",
"shell.execute_reply": "2024-04-17T11:55:50.873910Z"
},
"executionInfo": {
"elapsed": 3623,
Expand Down Expand Up @@ -197,7 +197,7 @@
"name": "stderr",
"output_type": "stream",
"text": [
"/tmp/ipykernel_1064508/2834990760.py:24: RuntimeWarning: invalid value encountered in log\n",
"/tmp/ipykernel_1085684/2834990760.py:24: RuntimeWarning: invalid value encountered in log\n",
" return params[0] + params[1] * np.log(params[2] * (x - params[3])) - 5*params[4]* np.exp(-0.00001*params[5]*(x-1500*params[6])**2) + 5*params[7]* np.exp(-0.000001*params[8]*(x-3000*params[9])**2) - 15*params[10]*np.exp(-0.0000001*params[11]*(x-8000*params[12])**2) - 5*params[13]*np.exp(-0.00000001*params[14]*(x-20000*params[15])**2)\n"
]
},
Expand Down Expand Up @@ -225,9 +225,9 @@
"name": "stderr",
"output_type": "stream",
"text": [
"/tmp/ipykernel_1064508/2834990760.py:30: RuntimeWarning: invalid value encountered in log\n",
"/tmp/ipykernel_1085684/2834990760.py:30: RuntimeWarning: invalid value encountered in log\n",
" return params[0] + params[1] * np.log(params[2] * (x - params[3])) + 5*params[4] * np.exp(-0.00001*params[5]*(x-1200*params[6])**2) - 10*params[7]*np.exp(-0.0000001*params[8]*(x-3300*params[9])**2) + 20*params[10]*np.exp(-0.00000001*params[11]*(x-12000*params[12])**2)\n",
"/tmp/ipykernel_1064508/2834990760.py:30: RuntimeWarning: overflow encountered in exp\n",
"/tmp/ipykernel_1085684/2834990760.py:30: RuntimeWarning: overflow encountered in exp\n",
" return params[0] + params[1] * np.log(params[2] * (x - params[3])) + 5*params[4] * np.exp(-0.00001*params[5]*(x-1200*params[6])**2) - 10*params[7]*np.exp(-0.0000001*params[8]*(x-3300*params[9])**2) + 20*params[10]*np.exp(-0.00000001*params[11]*(x-12000*params[12])**2)\n"
]
},
Expand Down Expand Up @@ -295,10 +295,10 @@
"height": 595
},
"execution": {
"iopub.execute_input": "2024-04-17T11:26:39.144106Z",
"iopub.status.busy": "2024-04-17T11:26:39.143863Z",
"iopub.status.idle": "2024-04-17T11:26:39.822019Z",
"shell.execute_reply": "2024-04-17T11:26:39.821323Z"
"iopub.execute_input": "2024-04-17T11:55:50.876499Z",
"iopub.status.busy": "2024-04-17T11:55:50.876296Z",
"iopub.status.idle": "2024-04-17T11:55:51.439723Z",
"shell.execute_reply": "2024-04-17T11:55:51.439116Z"
},
"executionInfo": {
"elapsed": 705,
Expand Down Expand Up @@ -349,10 +349,10 @@
"height": 632
},
"execution": {
"iopub.execute_input": "2024-04-17T11:26:39.824930Z",
"iopub.status.busy": "2024-04-17T11:26:39.824767Z",
"iopub.status.idle": "2024-04-17T11:26:40.163045Z",
"shell.execute_reply": "2024-04-17T11:26:40.162502Z"
"iopub.execute_input": "2024-04-17T11:55:51.442097Z",
"iopub.status.busy": "2024-04-17T11:55:51.441925Z",
"iopub.status.idle": "2024-04-17T11:55:51.727228Z",
"shell.execute_reply": "2024-04-17T11:55:51.726748Z"
},
"executionInfo": {
"elapsed": 524,
Expand All @@ -372,7 +372,7 @@
"name": "stderr",
"output_type": "stream",
"text": [
"/tmp/ipykernel_1064508/4279515257.py:10: RuntimeWarning: invalid value encountered in log10\n",
"/tmp/ipykernel_1085684/4279515257.py:10: RuntimeWarning: invalid value encountered in log10\n",
" return 40 * np.log10(B_f) + 94\n"
]
},
Expand Down
108 changes: 46 additions & 62 deletions zimtohrli.ipynb

Large diffs are not rendered by default.

0 comments on commit 335c491

Please sign in to comment.