Created
January 3, 2024 07:13
-
-
Save barrbrain/53b7df03304d5456e9212ba3c2e146a6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "cells": [ | |
| { | |
| "cell_type": "code", | |
| "execution_count": null, | |
| "id": "ce82fb56-000e-4dd7-bd69-90d76ceae2cb", | |
| "metadata": {}, | |
| "outputs": [], | |
| "source": [ | |
| "%matplotlib inline\n", | |
| "%config InlineBackend.figure_format = 'retina'\n", | |
| "\n", | |
| "import seaborn as sns\n", | |
| "import struct\n", | |
| "import numpy as np\n", | |
| "import matplotlib.pyplot as plt\n", | |
| "\n", | |
| "sns.set(style=\"darkgrid\", context=\"talk\")\n", | |
| "plt.style.use(\"dark_background\")\n", | |
| "plt.rcParams.update({\"grid.linewidth\":0.5, \"grid.alpha\":0.5})" | |
| ] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "execution_count": null, | |
| "id": "db394633-c140-4a54-8aae-2aebd966f8e5", | |
| "metadata": {}, | |
| "outputs": [], | |
| "source": [ | |
| "v6_6 = np.array([\n", | |
| " [1 +12.8958, 1 - .127002],\n", | |
| " [1 + 2.8195, 1 - .118419],\n", | |
| " [1 + 1.2497, 1 - .084560],\n", | |
| " [1 + .6296, 1 - .067793],\n", | |
| " [1 + .3479, 1 - .044871],\n", | |
| " [1 + .2918, 1 - .036907],\n", | |
| " [1 , 1 ],\n", | |
| " [1 - .0085, 1 + .008098],\n", | |
| " [1 - .3296, 1 + .054494],\n", | |
| " [1 - .3561, 1 + .194278],\n", | |
| " [1 - .5403, 1 + .509521],\n", | |
| "])\n", | |
| "\n", | |
| "v7 = np.array([\n", | |
| " [1 + 8.8559, 1 - .125922],\n", | |
| " [1 + 5.3445, 1 - .118419],\n", | |
| " [1 + 2.2441, 1 - .084560],\n", | |
| " [1 + .9837, 1 - .067793],\n", | |
| " [1 + .4504, 1 - .044871],\n", | |
| " [1 + .3202, 1 - .036907],\n", | |
| " [1 , 1 ],\n", | |
| " [1 - .0397, 1 + .008098],\n", | |
| " [1 - .2107, 1 + .054494],\n", | |
| " [1 - .4363, 1 + .194278],\n", | |
| " [1 - .5974, 1 + .509521],\n", | |
| "])\n", | |
| "\n", | |
| "relspeed = np.array([3.58, 1.46, 1.48, 1.57, 1.58, 1.65, 1.60, 1.65, 1.54, 1.63, 1.51])\n", | |
| "\n", | |
| "v7.T[0] = v6_6.T[0] / relspeed\n", | |
| "v7.T[1] / v7[6,1] - 1" | |
| ] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "execution_count": null, | |
| "id": "0915f6c8", | |
| "metadata": {}, | |
| "outputs": [], | |
| "source": [ | |
| "fig, ax = plt.subplots(figsize=(16, 9))\n", | |
| "ax.plot(*v6_6.T, 's-', label='v0.6.6 (aarch64)')\n", | |
| "ax.plot(*v7.T, 'D-', label='v0.7.0 (aarch64)')\n", | |
| "for i in range(11):\n", | |
| " ax.annotate(i, v6_6[i], v6_6[i] + .01)\n", | |
| " ax.annotate(i, v7[i], v7[i] + .01)\n", | |
| "\n", | |
| "ax.set_xlabel('⟵ Faster\\nRelative time')\n", | |
| "ax.set_ylabel('Relative bitrate\\n⟵ Smaller')\n", | |
| "plt.legend();" | |
| ] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "execution_count": null, | |
| "id": "2cdf3a5e", | |
| "metadata": {}, | |
| "outputs": [], | |
| "source": [ | |
| "fig, ax = plt.subplots(figsize=(16, 9))\n", | |
| "ax.plot(*(1 / v6_6).T, 's-', label='v0.6.6 (aarch64)')\n", | |
| "ax.plot(*(1 / v7).T, 'D-', label='v0.7.0 (aarch64)')\n", | |
| "for i in range(11):\n", | |
| " ax.annotate(i, (1 / v6_6)[i], (1 / v6_6)[i] - .023)\n", | |
| " ax.annotate(i, (1 / v7)[i], (1 / v7)[i] + .01)\n", | |
| "\n", | |
| "ax.set_xlabel('Faster ⟶\\nRelative speed')\n", | |
| "ax.set_ylabel('Relative compression\\nSmaller ⟶')\n", | |
| "plt.legend();" | |
| ] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "execution_count": null, | |
| "id": "631fe7e0-3215-426b-9e99-ad19b458c0ed", | |
| "metadata": {}, | |
| "outputs": [], | |
| "source": [] | |
| } | |
| ], | |
| "metadata": { | |
| "kernelspec": { | |
| "display_name": "Python 3 (ipykernel)", | |
| "language": "python", | |
| "name": "python3" | |
| }, | |
| "language_info": { | |
| "codemirror_mode": { | |
| "name": "ipython", | |
| "version": 3 | |
| }, | |
| "file_extension": ".py", | |
| "mimetype": "text/x-python", | |
| "name": "python", | |
| "nbconvert_exporter": "python", | |
| "pygments_lexer": "ipython3", | |
| "version": "3.12.0" | |
| } | |
| }, | |
| "nbformat": 4, | |
| "nbformat_minor": 5 | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment