neural-amp-modeler

Neural network emulator for guitar amplifiers
Log | Files | Refs | README | LICENSE

commit b95be59f002acad89bea34525809a88cb164d326
parent 5a08768b6f4fbdd52f9f79d741e9f340217e95f1
Author: Steven Atkinson <[email protected]>
Date:   Sun,  4 Dec 2022 17:23:21 -0800

Easy Colab

Diffstat:
Abin/train/easy_colab.ipynb | 1875+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Anam/train/__init__.py | 3+++
Anam/train/colab.py | 231+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 2109 insertions(+), 0 deletions(-)

diff --git a/bin/train/easy_colab.ipynb b/bin/train/easy_colab.ipynb @@ -0,0 +1,1875 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": { + "id": "TC3XkMetGWtK" + }, + "source": [ + "# Neural Amp Modeler (\"Easy mode\" Trainer)\n", + "This notebook allows you to train a neural amp model based on a pair of input/output WAV files that you have of the amp you want to model.\n", + "\n", + "**To use this notebook**:\n", + "Go to [colab.research.google.com](https://colab.research.google.com/), select the \"GitHub\" tab, and select this notebook. Or, if you've cloned the repo, you can upload it from your computer.\n", + "\n", + "๐Ÿ”ถ**Before you run**๐Ÿ”ถ\n", + "\n", + "Make sure to get a GPU! (Runtime->Change runtime type->Select \"GPU\" from the \"Hardware accelerator dropdown menu)\n", + "\n", + "โš **Warning**โš \n", + "\n", + "Google Colab GPU instances only last for 12 hours.\n", + "Plan your training accordingly!\n", + "\n", + "## Steps:\n", + "1. Get your data\n", + "2. Installation\n", + "3. Train!\n", + "4. Check the results and download your model" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "5CQleTk7GJV8" + }, + "source": [ + "## Step 1: Get data\n", + "We're gonna need data. \"Easy mode\" takes out a lot of the guesswork.\n", + "\n", + "### Step 1.1: Download the capture signal\n", + "\"Easy mode\" uses a pre-crafted \"capture signal\".\n", + "Download it [here](https://drive.google.com/file/d/1sVHtubguuXmDHRM8w1TmDaJEfB7-H9Vz/view?usp=share_link).\n", + "\n", + "### Step 1.2 Reamp your gear\n", + "Then reamp the gear you want to model using it. Save that reamp as \"output.wav\".\n", + "**Please use 48kHz, 24-bit, mono.** We'll support other sample rates etc in the future; sit tight!\n", + "\n", + "### Step 1.3: upload!\n", + "Upload the input (DI) and output (amped) files you want to use by clicking the Folder icon on the left โฌ… and then clicking the upload icon.\n", + "\n", + "Once you're done, run the next cell and I'll check that everything looks good." + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "2g_4GtFuGlO8" + }, + "source": [ + "## Step 2: Installation\n", + "Install `nam` into this Colab instance by running the next cell:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "vYQIpWr5EYRb", + "outputId": "9099af59-62ae-45b2-8cb6-415db054a73a" + }, + "outputs": [], + "source": [ + "!pip install git+https://github.com/sdatkinson/neural-amp-modeler.git@main\n", + "\n", + "from nam.train.colab import run" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Step 3: Train!\n", + "Here we go!\n", + "\n", + "๐Ÿ•™Training will go through 100 epochs and take just over 10 minutes.๐Ÿ•™\n", + "\n", + "If you want a better model, you can try training for more epochs--just put in a \n", + "different number before hitting go!" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "run(epochs=100)\n", + "# Psst! Curious how it's going?\n", + "# You can look under lightning_logs/version_0/checkpoints to see it saving its progress.\n", + "# Look for the number after \"ESR\" to go down. It will start around 1.0. 0.1 is ok, and \n", + "# 0.01 is really good. Anything higher than 0.1 is probably not great." + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "823KJ_L0Rchp" + }, + "source": [ + "## Step 4: Check the results and download your model\n", + "We're done!\n", + "\n", + "Have a look at the plot above to see how your model compares to the real gear you're modeling.\n", + "Hopefully it looks\n", + "Go to the file browser on the left panel โฌ… and download the contents of `exported_model` (you may need to hit the refresh button).\n", + "\n", + "You'll need `config.json` (the architecture) and `weights.npy` (the weights)--these are the information that the NAM plugin needs to run your model!\n", + "\n", + "Additionally, if you want to continue to train this model later you can download the lightning model artifacts from `lightning_logs`. If not, that's fine too.\n", + "\n", + "# ๐ŸŽธ **ENJOY!** ๐ŸŽธ" + ] + } + ], + "metadata": { + "accelerator": "GPU", + "colab": { + "name": "colab.ipynb", + "provenance": [] + }, + "gpuClass": "standard", + "kernelspec": { + "display_name": "Python 3.10.8 ('nam-dev2')", + "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.10.8" + }, + "orig_nbformat": 4, + "vscode": { + "interpreter": { + "hash": "82a9c8b64c0a2249409bc87c9822fa417e572ef85eb751a16b8174dc9eba53bb" + } + }, + "widgets": { + "application/vnd.jupyter.widget-state+json": { + "06d6093b2de54471b6d8ed706a3ec134": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "DescriptionStyleModel", + "state": { + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "DescriptionStyleModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "StyleView", + "description_width": "" + } + }, + "0ca1b22f10094010b1de29208e9dc446": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "ProgressStyleModel", + "state": { + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "ProgressStyleModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "StyleView", + "bar_color": null, + "description_width": "" + } + }, + "1b99071c17b24eb38edc8156e6ce5c82": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "DescriptionStyleModel", + "state": { + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "DescriptionStyleModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "StyleView", + "description_width": "" + } + }, + "22ddf8419783483c8f028e7864f70a01": { + "model_module": "@jupyter-widgets/base", + "model_module_version": "1.2.0", + "model_name": "LayoutModel", + "state": { + "_model_module": "@jupyter-widgets/base", + "_model_module_version": "1.2.0", + "_model_name": "LayoutModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "LayoutView", + "align_content": null, + "align_items": null, + "align_self": null, + "border": null, + "bottom": null, + "display": "inline-flex", + "flex": null, + "flex_flow": "row wrap", + "grid_area": null, + "grid_auto_columns": null, + "grid_auto_flow": null, + "grid_auto_rows": null, + "grid_column": null, + "grid_gap": null, + "grid_row": null, + "grid_template_areas": null, + "grid_template_columns": null, + "grid_template_rows": null, + "height": null, + "justify_content": null, + "justify_items": null, + "left": null, + "margin": null, + "max_height": null, + "max_width": null, + "min_height": null, + "min_width": null, + "object_fit": null, + "object_position": null, + "order": null, + "overflow": null, + "overflow_x": null, + "overflow_y": null, + "padding": null, + "right": null, + "top": null, + "visibility": "hidden", + "width": "100%" + } + }, + "267c776505af4500a78055da11d048c3": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "FloatProgressModel", + "state": { + "_dom_classes": [], + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "FloatProgressModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/controls", + "_view_module_version": "1.5.0", + "_view_name": "ProgressView", + "bar_style": "", + "description": "", + "description_tooltip": null, + "layout": "IPY_MODEL_c8cbf6d2083c482ca05956b1cca62d8f", + "max": 1, + "min": 0, + "orientation": "horizontal", + "style": "IPY_MODEL_0ca1b22f10094010b1de29208e9dc446", + "value": 1 + } + }, + "307f75cef4f44ad58a710badda886e37": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "DescriptionStyleModel", + "state": { + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "DescriptionStyleModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "StyleView", + "description_width": "" + } + }, + "35a2785ec34841faa4a42740859a1787": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "HBoxModel", + "state": { + "_dom_classes": [], + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "HBoxModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/controls", + "_view_module_version": "1.5.0", + "_view_name": "HBoxView", + "box_style": "", + "children": [ + "IPY_MODEL_e73493ee7ea54e9e90e97d8235c0d034", + "IPY_MODEL_bb9f87963c094647aba5a9fe9f658a7c", + "IPY_MODEL_99d70d6c342241208b9e82b077e7992a" + ], + "layout": "IPY_MODEL_e8210bfbf84248c8ba908837a8d991a9" + } + }, + "375d8e834c5b4ef4ae07918107b7b88d": { + "model_module": "@jupyter-widgets/base", + "model_module_version": "1.2.0", + "model_name": "LayoutModel", + "state": { + "_model_module": "@jupyter-widgets/base", + "_model_module_version": "1.2.0", + "_model_name": "LayoutModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "LayoutView", + "align_content": null, + "align_items": null, + "align_self": null, + "border": null, + "bottom": null, + "display": null, + "flex": null, + "flex_flow": null, + "grid_area": null, + "grid_auto_columns": null, + "grid_auto_flow": null, + "grid_auto_rows": null, + "grid_column": null, + "grid_gap": null, + "grid_row": null, + "grid_template_areas": null, + "grid_template_columns": null, + "grid_template_rows": null, + "height": null, + "justify_content": null, + "justify_items": null, + "left": null, + "margin": null, + "max_height": null, + "max_width": null, + "min_height": null, + "min_width": null, + "object_fit": null, + "object_position": null, + "order": null, + "overflow": null, + "overflow_x": null, + "overflow_y": null, + "padding": null, + "right": null, + "top": null, + "visibility": null, + "width": null + } + }, + "3d31c1682afa4d7ab79a8a3631b8aad9": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "DescriptionStyleModel", + "state": { + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "DescriptionStyleModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "StyleView", + "description_width": "" + } + }, + "3e176bf207e9462aaf411acd01b07df2": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "FloatProgressModel", + "state": { + "_dom_classes": [], + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "FloatProgressModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/controls", + "_view_module_version": "1.5.0", + "_view_name": "ProgressView", + "bar_style": "", + "description": "", + "description_tooltip": null, + "layout": "IPY_MODEL_5cc41ab2a3a245268826d42cdfc8bcf3", + "max": 1, + "min": 0, + "orientation": "horizontal", + "style": "IPY_MODEL_5c2acdd3a6cd457e8f7ad2d79284a7a6", + "value": 1 + } + }, + "445e26349f454e8293424e1685f0091a": { + "model_module": "@jupyter-widgets/base", + "model_module_version": "1.2.0", + "model_name": "LayoutModel", + "state": { + "_model_module": "@jupyter-widgets/base", + "_model_module_version": "1.2.0", + "_model_name": "LayoutModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "LayoutView", + "align_content": null, + "align_items": null, + "align_self": null, + "border": null, + "bottom": null, + "display": null, + "flex": null, + "flex_flow": null, + "grid_area": null, + "grid_auto_columns": null, + "grid_auto_flow": null, + "grid_auto_rows": null, + "grid_column": null, + "grid_gap": null, + "grid_row": null, + "grid_template_areas": null, + "grid_template_columns": null, + "grid_template_rows": null, + "height": null, + "justify_content": null, + "justify_items": null, + "left": null, + "margin": null, + "max_height": null, + "max_width": null, + "min_height": null, + "min_width": null, + "object_fit": null, + "object_position": null, + "order": null, + "overflow": null, + "overflow_x": null, + "overflow_y": null, + "padding": null, + "right": null, + "top": null, + "visibility": null, + "width": null + } + }, + "450603dc0c8c41e5894d4b9c5795b260": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "HTMLModel", + "state": { + "_dom_classes": [], + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "HTMLModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/controls", + "_view_module_version": "1.5.0", + "_view_name": "HTMLView", + "description": "", + "description_tooltip": null, + "layout": "IPY_MODEL_bd6b703d97394a4dbc1ae95eec47aba2", + "placeholder": "โ€‹", + "style": "IPY_MODEL_a75349bcbe9f484c823d650542b9e003", + "value": "Validation DataLoader 0: 100%" + } + }, + "4506d1d24cc94655b3f04722c5cc4d7e": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "DescriptionStyleModel", + "state": { + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "DescriptionStyleModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "StyleView", + "description_width": "" + } + }, + "464621ad83404012844fc51e5bbc233a": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "HTMLModel", + "state": { + "_dom_classes": [], + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "HTMLModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/controls", + "_view_module_version": "1.5.0", + "_view_name": "HTMLView", + "description": "", + "description_tooltip": null, + "layout": "IPY_MODEL_8a9dfc6232774eb783dc7e6330cd5258", + "placeholder": "โ€‹", + "style": "IPY_MODEL_91498ce3e7fe4d67b519df20d89dca89", + "value": "Validation DataLoader 0: 100%" + } + }, + "5c2acdd3a6cd457e8f7ad2d79284a7a6": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "ProgressStyleModel", + "state": { + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "ProgressStyleModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "StyleView", + "bar_color": null, + "description_width": "" + } + }, + "5c59d810fd084268afc9e301b6527a74": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "ProgressStyleModel", + "state": { + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "ProgressStyleModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "StyleView", + "bar_color": null, + "description_width": "" + } + }, + "5cc41ab2a3a245268826d42cdfc8bcf3": { + "model_module": "@jupyter-widgets/base", + "model_module_version": "1.2.0", + "model_name": "LayoutModel", + "state": { + "_model_module": "@jupyter-widgets/base", + "_model_module_version": "1.2.0", + "_model_name": "LayoutModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "LayoutView", + "align_content": null, + "align_items": null, + "align_self": null, + "border": null, + "bottom": null, + "display": null, + "flex": "2", + "flex_flow": null, + "grid_area": null, + "grid_auto_columns": null, + "grid_auto_flow": null, + "grid_auto_rows": null, + "grid_column": null, + "grid_gap": null, + "grid_row": null, + "grid_template_areas": null, + "grid_template_columns": null, + "grid_template_rows": null, + "height": null, + "justify_content": null, + "justify_items": null, + "left": null, + "margin": null, + "max_height": null, + "max_width": null, + "min_height": null, + "min_width": null, + "object_fit": null, + "object_position": null, + "order": null, + "overflow": null, + "overflow_x": null, + "overflow_y": null, + "padding": null, + "right": null, + "top": null, + "visibility": null, + "width": null + } + }, + "5e4ef9e9ca8b4134a395aac882b40577": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "FloatProgressModel", + "state": { + "_dom_classes": [], + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "FloatProgressModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/controls", + "_view_module_version": "1.5.0", + "_view_name": "ProgressView", + "bar_style": "", + "description": "", + "description_tooltip": null, + "layout": "IPY_MODEL_ce4c4bbd8fd14beab87287b33ca3dcc4", + "max": 1, + "min": 0, + "orientation": "horizontal", + "style": "IPY_MODEL_5c59d810fd084268afc9e301b6527a74", + "value": 1 + } + }, + "67efb4a21bfb42cfb6aa9fca9652e476": { + "model_module": "@jupyter-widgets/base", + "model_module_version": "1.2.0", + "model_name": "LayoutModel", + "state": { + "_model_module": "@jupyter-widgets/base", + "_model_module_version": "1.2.0", + "_model_name": "LayoutModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "LayoutView", + "align_content": null, + "align_items": null, + "align_self": null, + "border": null, + "bottom": null, + "display": null, + "flex": null, + "flex_flow": null, + "grid_area": null, + "grid_auto_columns": null, + "grid_auto_flow": null, + "grid_auto_rows": null, + "grid_column": null, + "grid_gap": null, + "grid_row": null, + "grid_template_areas": null, + "grid_template_columns": null, + "grid_template_rows": null, + "height": null, + "justify_content": null, + "justify_items": null, + "left": null, + "margin": null, + "max_height": null, + "max_width": null, + "min_height": null, + "min_width": null, + "object_fit": null, + "object_position": null, + "order": null, + "overflow": null, + "overflow_x": null, + "overflow_y": null, + "padding": null, + "right": null, + "top": null, + "visibility": null, + "width": null + } + }, + "681bb4a793864358a5290ca85ae7c84b": { + "model_module": "@jupyter-widgets/base", + "model_module_version": "1.2.0", + "model_name": "LayoutModel", + "state": { + "_model_module": "@jupyter-widgets/base", + "_model_module_version": "1.2.0", + "_model_name": "LayoutModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "LayoutView", + "align_content": null, + "align_items": null, + "align_self": null, + "border": null, + "bottom": null, + "display": "inline-flex", + "flex": null, + "flex_flow": "row wrap", + "grid_area": null, + "grid_auto_columns": null, + "grid_auto_flow": null, + "grid_auto_rows": null, + "grid_column": null, + "grid_gap": null, + "grid_row": null, + "grid_template_areas": null, + "grid_template_columns": null, + "grid_template_rows": null, + "height": null, + "justify_content": null, + "justify_items": null, + "left": null, + "margin": null, + "max_height": null, + "max_width": null, + "min_height": null, + "min_width": null, + "object_fit": null, + "object_position": null, + "order": null, + "overflow": null, + "overflow_x": null, + "overflow_y": null, + "padding": null, + "right": null, + "top": null, + "visibility": "hidden", + "width": "100%" + } + }, + "70b9099e79fc430699493b4ac64e8952": { + "model_module": "@jupyter-widgets/base", + "model_module_version": "1.2.0", + "model_name": "LayoutModel", + "state": { + "_model_module": "@jupyter-widgets/base", + "_model_module_version": "1.2.0", + "_model_name": "LayoutModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "LayoutView", + "align_content": null, + "align_items": null, + "align_self": null, + "border": null, + "bottom": null, + "display": "inline-flex", + "flex": null, + "flex_flow": "row wrap", + "grid_area": null, + "grid_auto_columns": null, + "grid_auto_flow": null, + "grid_auto_rows": null, + "grid_column": null, + "grid_gap": null, + "grid_row": null, + "grid_template_areas": null, + "grid_template_columns": null, + "grid_template_rows": null, + "height": null, + "justify_content": null, + "justify_items": null, + "left": null, + "margin": null, + "max_height": null, + "max_width": null, + "min_height": null, + "min_width": null, + "object_fit": null, + "object_position": null, + "order": null, + "overflow": null, + "overflow_x": null, + "overflow_y": null, + "padding": null, + "right": null, + "top": null, + "visibility": "hidden", + "width": "100%" + } + }, + "751d6a7ad60749f3bce1b3055253b56e": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "HTMLModel", + "state": { + "_dom_classes": [], + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "HTMLModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/controls", + "_view_module_version": "1.5.0", + "_view_name": "HTMLView", + "description": "", + "description_tooltip": null, + "layout": "IPY_MODEL_8232a7f579b64fb386392ed3b283690b", + "placeholder": "โ€‹", + "style": "IPY_MODEL_894ef60aacff4a6ea1e55d9e3046c17f", + "value": " 1/1 [00:00&lt;00:00, 27.35it/s]" + } + }, + "7b2cbe78308b43ada8d2d51d8cc33988": { + "model_module": "@jupyter-widgets/base", + "model_module_version": "1.2.0", + "model_name": "LayoutModel", + "state": { + "_model_module": "@jupyter-widgets/base", + "_model_module_version": "1.2.0", + "_model_name": "LayoutModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "LayoutView", + "align_content": null, + "align_items": null, + "align_self": null, + "border": null, + "bottom": null, + "display": "inline-flex", + "flex": null, + "flex_flow": "row wrap", + "grid_area": null, + "grid_auto_columns": null, + "grid_auto_flow": null, + "grid_auto_rows": null, + "grid_column": null, + "grid_gap": null, + "grid_row": null, + "grid_template_areas": null, + "grid_template_columns": null, + "grid_template_rows": null, + "height": null, + "justify_content": null, + "justify_items": null, + "left": null, + "margin": null, + "max_height": null, + "max_width": null, + "min_height": null, + "min_width": null, + "object_fit": null, + "object_position": null, + "order": null, + "overflow": null, + "overflow_x": null, + "overflow_y": null, + "padding": null, + "right": null, + "top": null, + "visibility": null, + "width": "100%" + } + }, + "8232a7f579b64fb386392ed3b283690b": { + "model_module": "@jupyter-widgets/base", + "model_module_version": "1.2.0", + "model_name": "LayoutModel", + "state": { + "_model_module": "@jupyter-widgets/base", + "_model_module_version": "1.2.0", + "_model_name": "LayoutModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "LayoutView", + "align_content": null, + "align_items": null, + "align_self": null, + "border": null, + "bottom": null, + "display": null, + "flex": null, + "flex_flow": null, + "grid_area": null, + "grid_auto_columns": null, + "grid_auto_flow": null, + "grid_auto_rows": null, + "grid_column": null, + "grid_gap": null, + "grid_row": null, + "grid_template_areas": null, + "grid_template_columns": null, + "grid_template_rows": null, + "height": null, + "justify_content": null, + "justify_items": null, + "left": null, + "margin": null, + "max_height": null, + "max_width": null, + "min_height": null, + "min_width": null, + "object_fit": null, + "object_position": null, + "order": null, + "overflow": null, + "overflow_x": null, + "overflow_y": null, + "padding": null, + "right": null, + "top": null, + "visibility": null, + "width": null + } + }, + "85e37359486d4ea0981b97af675c6261": { + "model_module": "@jupyter-widgets/base", + "model_module_version": "1.2.0", + "model_name": "LayoutModel", + "state": { + "_model_module": "@jupyter-widgets/base", + "_model_module_version": "1.2.0", + "_model_name": "LayoutModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "LayoutView", + "align_content": null, + "align_items": null, + "align_self": null, + "border": null, + "bottom": null, + "display": null, + "flex": null, + "flex_flow": null, + "grid_area": null, + "grid_auto_columns": null, + "grid_auto_flow": null, + "grid_auto_rows": null, + "grid_column": null, + "grid_gap": null, + "grid_row": null, + "grid_template_areas": null, + "grid_template_columns": null, + "grid_template_rows": null, + "height": null, + "justify_content": null, + "justify_items": null, + "left": null, + "margin": null, + "max_height": null, + "max_width": null, + "min_height": null, + "min_width": null, + "object_fit": null, + "object_position": null, + "order": null, + "overflow": null, + "overflow_x": null, + "overflow_y": null, + "padding": null, + "right": null, + "top": null, + "visibility": null, + "width": null + } + }, + "894ef60aacff4a6ea1e55d9e3046c17f": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "DescriptionStyleModel", + "state": { + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "DescriptionStyleModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "StyleView", + "description_width": "" + } + }, + "8a9dfc6232774eb783dc7e6330cd5258": { + "model_module": "@jupyter-widgets/base", + "model_module_version": "1.2.0", + "model_name": "LayoutModel", + "state": { + "_model_module": "@jupyter-widgets/base", + "_model_module_version": "1.2.0", + "_model_name": "LayoutModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "LayoutView", + "align_content": null, + "align_items": null, + "align_self": null, + "border": null, + "bottom": null, + "display": null, + "flex": null, + "flex_flow": null, + "grid_area": null, + "grid_auto_columns": null, + "grid_auto_flow": null, + "grid_auto_rows": null, + "grid_column": null, + "grid_gap": null, + "grid_row": null, + "grid_template_areas": null, + "grid_template_columns": null, + "grid_template_rows": null, + "height": null, + "justify_content": null, + "justify_items": null, + "left": null, + "margin": null, + "max_height": null, + "max_width": null, + "min_height": null, + "min_width": null, + "object_fit": null, + "object_position": null, + "order": null, + "overflow": null, + "overflow_x": null, + "overflow_y": null, + "padding": null, + "right": null, + "top": null, + "visibility": null, + "width": null + } + }, + "91498ce3e7fe4d67b519df20d89dca89": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "DescriptionStyleModel", + "state": { + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "DescriptionStyleModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "StyleView", + "description_width": "" + } + }, + "936c88fd53024c54b03e70c458744ec1": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "HTMLModel", + "state": { + "_dom_classes": [], + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "HTMLModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/controls", + "_view_module_version": "1.5.0", + "_view_name": "HTMLView", + "description": "", + "description_tooltip": null, + "layout": "IPY_MODEL_375d8e834c5b4ef4ae07918107b7b88d", + "placeholder": "โ€‹", + "style": "IPY_MODEL_307f75cef4f44ad58a710badda886e37", + "value": "Sanity Checking DataLoader 0: 100%" + } + }, + "976be174250042ffb82603a8747c4e55": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "HTMLModel", + "state": { + "_dom_classes": [], + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "HTMLModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/controls", + "_view_module_version": "1.5.0", + "_view_name": "HTMLView", + "description": "", + "description_tooltip": null, + "layout": "IPY_MODEL_dcec65e867484ec9b110ce76055eaf85", + "placeholder": "โ€‹", + "style": "IPY_MODEL_cd773c524372402a88138b21a25f09bf", + "value": "Epoch 3: 14%" + } + }, + "99d70d6c342241208b9e82b077e7992a": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "HTMLModel", + "state": { + "_dom_classes": [], + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "HTMLModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/controls", + "_view_module_version": "1.5.0", + "_view_name": "HTMLView", + "description": "", + "description_tooltip": null, + "layout": "IPY_MODEL_445e26349f454e8293424e1685f0091a", + "placeholder": "โ€‹", + "style": "IPY_MODEL_c0979cfc05374f68bea9e8d81aad87b3", + "value": " 1/1 [00:00&lt;00:00, 27.40it/s]" + } + }, + "a69bf48d53dd417cbd06f7442c27649d": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "HTMLModel", + "state": { + "_dom_classes": [], + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "HTMLModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/controls", + "_view_module_version": "1.5.0", + "_view_name": "HTMLView", + "description": "", + "description_tooltip": null, + "layout": "IPY_MODEL_85e37359486d4ea0981b97af675c6261", + "placeholder": "โ€‹", + "style": "IPY_MODEL_4506d1d24cc94655b3f04722c5cc4d7e", + "value": " 1/1 [00:00&lt;00:00, 24.37it/s]" + } + }, + "a75349bcbe9f484c823d650542b9e003": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "DescriptionStyleModel", + "state": { + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "DescriptionStyleModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "StyleView", + "description_width": "" + } + }, + "a79743b7948f44e48de0c95ce6a8d337": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "ProgressStyleModel", + "state": { + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "ProgressStyleModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "StyleView", + "bar_color": null, + "description_width": "" + } + }, + "afd14c8a8a87404da80e146a794b0263": { + "model_module": "@jupyter-widgets/base", + "model_module_version": "1.2.0", + "model_name": "LayoutModel", + "state": { + "_model_module": "@jupyter-widgets/base", + "_model_module_version": "1.2.0", + "_model_name": "LayoutModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "LayoutView", + "align_content": null, + "align_items": null, + "align_self": null, + "border": null, + "bottom": null, + "display": null, + "flex": "2", + "flex_flow": null, + "grid_area": null, + "grid_auto_columns": null, + "grid_auto_flow": null, + "grid_auto_rows": null, + "grid_column": null, + "grid_gap": null, + "grid_row": null, + "grid_template_areas": null, + "grid_template_columns": null, + "grid_template_rows": null, + "height": null, + "justify_content": null, + "justify_items": null, + "left": null, + "margin": null, + "max_height": null, + "max_width": null, + "min_height": null, + "min_width": null, + "object_fit": null, + "object_position": null, + "order": null, + "overflow": null, + "overflow_x": null, + "overflow_y": null, + "padding": null, + "right": null, + "top": null, + "visibility": null, + "width": null + } + }, + "b8f78af1fd9641b08f6ff26dddd45eee": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "ProgressStyleModel", + "state": { + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "ProgressStyleModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "StyleView", + "bar_color": null, + "description_width": "" + } + }, + "bb9f87963c094647aba5a9fe9f658a7c": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "FloatProgressModel", + "state": { + "_dom_classes": [], + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "FloatProgressModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/controls", + "_view_module_version": "1.5.0", + "_view_name": "ProgressView", + "bar_style": "", + "description": "", + "description_tooltip": null, + "layout": "IPY_MODEL_afd14c8a8a87404da80e146a794b0263", + "max": 1, + "min": 0, + "orientation": "horizontal", + "style": "IPY_MODEL_a79743b7948f44e48de0c95ce6a8d337", + "value": 1 + } + }, + "bd6b703d97394a4dbc1ae95eec47aba2": { + "model_module": "@jupyter-widgets/base", + "model_module_version": "1.2.0", + "model_name": "LayoutModel", + "state": { + "_model_module": "@jupyter-widgets/base", + "_model_module_version": "1.2.0", + "_model_name": "LayoutModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "LayoutView", + "align_content": null, + "align_items": null, + "align_self": null, + "border": null, + "bottom": null, + "display": null, + "flex": null, + "flex_flow": null, + "grid_area": null, + "grid_auto_columns": null, + "grid_auto_flow": null, + "grid_auto_rows": null, + "grid_column": null, + "grid_gap": null, + "grid_row": null, + "grid_template_areas": null, + "grid_template_columns": null, + "grid_template_rows": null, + "height": null, + "justify_content": null, + "justify_items": null, + "left": null, + "margin": null, + "max_height": null, + "max_width": null, + "min_height": null, + "min_width": null, + "object_fit": null, + "object_position": null, + "order": null, + "overflow": null, + "overflow_x": null, + "overflow_y": null, + "padding": null, + "right": null, + "top": null, + "visibility": null, + "width": null + } + }, + "be9d778184e4429c92a6362baf0404b0": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "HTMLModel", + "state": { + "_dom_classes": [], + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "HTMLModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/controls", + "_view_module_version": "1.5.0", + "_view_name": "HTMLView", + "description": "", + "description_tooltip": null, + "layout": "IPY_MODEL_67efb4a21bfb42cfb6aa9fca9652e476", + "placeholder": "โ€‹", + "style": "IPY_MODEL_06d6093b2de54471b6d8ed706a3ec134", + "value": " 9/66 [00:00&lt;00:05, 10.77it/s, loss=0.00196, v_num=0]" + } + }, + "c0979cfc05374f68bea9e8d81aad87b3": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "DescriptionStyleModel", + "state": { + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "DescriptionStyleModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "StyleView", + "description_width": "" + } + }, + "c2621945d38c48f6910abc5dbb9ecbc2": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "FloatProgressModel", + "state": { + "_dom_classes": [], + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "FloatProgressModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/controls", + "_view_module_version": "1.5.0", + "_view_name": "ProgressView", + "bar_style": "", + "description": "", + "description_tooltip": null, + "layout": "IPY_MODEL_d0efa8f7a027477f8359b1b0af1695b7", + "max": 66, + "min": 0, + "orientation": "horizontal", + "style": "IPY_MODEL_b8f78af1fd9641b08f6ff26dddd45eee", + "value": 9 + } + }, + "c8cbf6d2083c482ca05956b1cca62d8f": { + "model_module": "@jupyter-widgets/base", + "model_module_version": "1.2.0", + "model_name": "LayoutModel", + "state": { + "_model_module": "@jupyter-widgets/base", + "_model_module_version": "1.2.0", + "_model_name": "LayoutModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "LayoutView", + "align_content": null, + "align_items": null, + "align_self": null, + "border": null, + "bottom": null, + "display": null, + "flex": "2", + "flex_flow": null, + "grid_area": null, + "grid_auto_columns": null, + "grid_auto_flow": null, + "grid_auto_rows": null, + "grid_column": null, + "grid_gap": null, + "grid_row": null, + "grid_template_areas": null, + "grid_template_columns": null, + "grid_template_rows": null, + "height": null, + "justify_content": null, + "justify_items": null, + "left": null, + "margin": null, + "max_height": null, + "max_width": null, + "min_height": null, + "min_width": null, + "object_fit": null, + "object_position": null, + "order": null, + "overflow": null, + "overflow_x": null, + "overflow_y": null, + "padding": null, + "right": null, + "top": null, + "visibility": null, + "width": null + } + }, + "ccc46a9dc19846ef969fdf06c9c82176": { + "model_module": "@jupyter-widgets/base", + "model_module_version": "1.2.0", + "model_name": "LayoutModel", + "state": { + "_model_module": "@jupyter-widgets/base", + "_model_module_version": "1.2.0", + "_model_name": "LayoutModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "LayoutView", + "align_content": null, + "align_items": null, + "align_self": null, + "border": null, + "bottom": null, + "display": null, + "flex": null, + "flex_flow": null, + "grid_area": null, + "grid_auto_columns": null, + "grid_auto_flow": null, + "grid_auto_rows": null, + "grid_column": null, + "grid_gap": null, + "grid_row": null, + "grid_template_areas": null, + "grid_template_columns": null, + "grid_template_rows": null, + "height": null, + "justify_content": null, + "justify_items": null, + "left": null, + "margin": null, + "max_height": null, + "max_width": null, + "min_height": null, + "min_width": null, + "object_fit": null, + "object_position": null, + "order": null, + "overflow": null, + "overflow_x": null, + "overflow_y": null, + "padding": null, + "right": null, + "top": null, + "visibility": null, + "width": null + } + }, + "cd773c524372402a88138b21a25f09bf": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "DescriptionStyleModel", + "state": { + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "DescriptionStyleModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "StyleView", + "description_width": "" + } + }, + "ce4c4bbd8fd14beab87287b33ca3dcc4": { + "model_module": "@jupyter-widgets/base", + "model_module_version": "1.2.0", + "model_name": "LayoutModel", + "state": { + "_model_module": "@jupyter-widgets/base", + "_model_module_version": "1.2.0", + "_model_name": "LayoutModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "LayoutView", + "align_content": null, + "align_items": null, + "align_self": null, + "border": null, + "bottom": null, + "display": null, + "flex": "2", + "flex_flow": null, + "grid_area": null, + "grid_auto_columns": null, + "grid_auto_flow": null, + "grid_auto_rows": null, + "grid_column": null, + "grid_gap": null, + "grid_row": null, + "grid_template_areas": null, + "grid_template_columns": null, + "grid_template_rows": null, + "height": null, + "justify_content": null, + "justify_items": null, + "left": null, + "margin": null, + "max_height": null, + "max_width": null, + "min_height": null, + "min_width": null, + "object_fit": null, + "object_position": null, + "order": null, + "overflow": null, + "overflow_x": null, + "overflow_y": null, + "padding": null, + "right": null, + "top": null, + "visibility": null, + "width": null + } + }, + "d0efa8f7a027477f8359b1b0af1695b7": { + "model_module": "@jupyter-widgets/base", + "model_module_version": "1.2.0", + "model_name": "LayoutModel", + "state": { + "_model_module": "@jupyter-widgets/base", + "_model_module_version": "1.2.0", + "_model_name": "LayoutModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "LayoutView", + "align_content": null, + "align_items": null, + "align_self": null, + "border": null, + "bottom": null, + "display": null, + "flex": "2", + "flex_flow": null, + "grid_area": null, + "grid_auto_columns": null, + "grid_auto_flow": null, + "grid_auto_rows": null, + "grid_column": null, + "grid_gap": null, + "grid_row": null, + "grid_template_areas": null, + "grid_template_columns": null, + "grid_template_rows": null, + "height": null, + "justify_content": null, + "justify_items": null, + "left": null, + "margin": null, + "max_height": null, + "max_width": null, + "min_height": null, + "min_width": null, + "object_fit": null, + "object_position": null, + "order": null, + "overflow": null, + "overflow_x": null, + "overflow_y": null, + "padding": null, + "right": null, + "top": null, + "visibility": null, + "width": null + } + }, + "d5d9d5da8a544cbe8a3269db2e68281b": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "HBoxModel", + "state": { + "_dom_classes": [], + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "HBoxModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/controls", + "_view_module_version": "1.5.0", + "_view_name": "HBoxView", + "box_style": "", + "children": [ + "IPY_MODEL_450603dc0c8c41e5894d4b9c5795b260", + "IPY_MODEL_5e4ef9e9ca8b4134a395aac882b40577", + "IPY_MODEL_a69bf48d53dd417cbd06f7442c27649d" + ], + "layout": "IPY_MODEL_681bb4a793864358a5290ca85ae7c84b" + } + }, + "d7513d16f8c0440b813e8a05fdce3a6a": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "HBoxModel", + "state": { + "_dom_classes": [], + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "HBoxModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/controls", + "_view_module_version": "1.5.0", + "_view_name": "HBoxView", + "box_style": "", + "children": [ + "IPY_MODEL_936c88fd53024c54b03e70c458744ec1", + "IPY_MODEL_267c776505af4500a78055da11d048c3", + "IPY_MODEL_f2020a5340784d01aa1316eb0489ab10" + ], + "layout": "IPY_MODEL_22ddf8419783483c8f028e7864f70a01" + } + }, + "dcec65e867484ec9b110ce76055eaf85": { + "model_module": "@jupyter-widgets/base", + "model_module_version": "1.2.0", + "model_name": "LayoutModel", + "state": { + "_model_module": "@jupyter-widgets/base", + "_model_module_version": "1.2.0", + "_model_name": "LayoutModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "LayoutView", + "align_content": null, + "align_items": null, + "align_self": null, + "border": null, + "bottom": null, + "display": null, + "flex": null, + "flex_flow": null, + "grid_area": null, + "grid_auto_columns": null, + "grid_auto_flow": null, + "grid_auto_rows": null, + "grid_column": null, + "grid_gap": null, + "grid_row": null, + "grid_template_areas": null, + "grid_template_columns": null, + "grid_template_rows": null, + "height": null, + "justify_content": null, + "justify_items": null, + "left": null, + "margin": null, + "max_height": null, + "max_width": null, + "min_height": null, + "min_width": null, + "object_fit": null, + "object_position": null, + "order": null, + "overflow": null, + "overflow_x": null, + "overflow_y": null, + "padding": null, + "right": null, + "top": null, + "visibility": null, + "width": null + } + }, + "e17f3521a9ab43c7b0c5b21109c3be21": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "HBoxModel", + "state": { + "_dom_classes": [], + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "HBoxModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/controls", + "_view_module_version": "1.5.0", + "_view_name": "HBoxView", + "box_style": "", + "children": [ + "IPY_MODEL_464621ad83404012844fc51e5bbc233a", + "IPY_MODEL_3e176bf207e9462aaf411acd01b07df2", + "IPY_MODEL_751d6a7ad60749f3bce1b3055253b56e" + ], + "layout": "IPY_MODEL_70b9099e79fc430699493b4ac64e8952" + } + }, + "e626966e9c38471fa6e314d1ad1ac3e2": { + "model_module": "@jupyter-widgets/base", + "model_module_version": "1.2.0", + "model_name": "LayoutModel", + "state": { + "_model_module": "@jupyter-widgets/base", + "_model_module_version": "1.2.0", + "_model_name": "LayoutModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "LayoutView", + "align_content": null, + "align_items": null, + "align_self": null, + "border": null, + "bottom": null, + "display": null, + "flex": null, + "flex_flow": null, + "grid_area": null, + "grid_auto_columns": null, + "grid_auto_flow": null, + "grid_auto_rows": null, + "grid_column": null, + "grid_gap": null, + "grid_row": null, + "grid_template_areas": null, + "grid_template_columns": null, + "grid_template_rows": null, + "height": null, + "justify_content": null, + "justify_items": null, + "left": null, + "margin": null, + "max_height": null, + "max_width": null, + "min_height": null, + "min_width": null, + "object_fit": null, + "object_position": null, + "order": null, + "overflow": null, + "overflow_x": null, + "overflow_y": null, + "padding": null, + "right": null, + "top": null, + "visibility": null, + "width": null + } + }, + "e73493ee7ea54e9e90e97d8235c0d034": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "HTMLModel", + "state": { + "_dom_classes": [], + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "HTMLModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/controls", + "_view_module_version": "1.5.0", + "_view_name": "HTMLView", + "description": "", + "description_tooltip": null, + "layout": "IPY_MODEL_ccc46a9dc19846ef969fdf06c9c82176", + "placeholder": "โ€‹", + "style": "IPY_MODEL_3d31c1682afa4d7ab79a8a3631b8aad9", + "value": "Validation DataLoader 0: 100%" + } + }, + "e8210bfbf84248c8ba908837a8d991a9": { + "model_module": "@jupyter-widgets/base", + "model_module_version": "1.2.0", + "model_name": "LayoutModel", + "state": { + "_model_module": "@jupyter-widgets/base", + "_model_module_version": "1.2.0", + "_model_name": "LayoutModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "LayoutView", + "align_content": null, + "align_items": null, + "align_self": null, + "border": null, + "bottom": null, + "display": "inline-flex", + "flex": null, + "flex_flow": "row wrap", + "grid_area": null, + "grid_auto_columns": null, + "grid_auto_flow": null, + "grid_auto_rows": null, + "grid_column": null, + "grid_gap": null, + "grid_row": null, + "grid_template_areas": null, + "grid_template_columns": null, + "grid_template_rows": null, + "height": null, + "justify_content": null, + "justify_items": null, + "left": null, + "margin": null, + "max_height": null, + "max_width": null, + "min_height": null, + "min_width": null, + "object_fit": null, + "object_position": null, + "order": null, + "overflow": null, + "overflow_x": null, + "overflow_y": null, + "padding": null, + "right": null, + "top": null, + "visibility": "hidden", + "width": "100%" + } + }, + "f2020a5340784d01aa1316eb0489ab10": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "HTMLModel", + "state": { + "_dom_classes": [], + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "HTMLModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/controls", + "_view_module_version": "1.5.0", + "_view_name": "HTMLView", + "description": "", + "description_tooltip": null, + "layout": "IPY_MODEL_e626966e9c38471fa6e314d1ad1ac3e2", + "placeholder": "โ€‹", + "style": "IPY_MODEL_1b99071c17b24eb38edc8156e6ce5c82", + "value": " 1/1 [00:05&lt;00:00, 5.62s/it]" + } + }, + "fd2997ef94a94998956a256fe0522cd9": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "HBoxModel", + "state": { + "_dom_classes": [], + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "HBoxModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/controls", + "_view_module_version": "1.5.0", + "_view_name": "HBoxView", + "box_style": "", + "children": [ + "IPY_MODEL_976be174250042ffb82603a8747c4e55", + "IPY_MODEL_c2621945d38c48f6910abc5dbb9ecbc2", + "IPY_MODEL_be9d778184e4429c92a6362baf0404b0" + ], + "layout": "IPY_MODEL_7b2cbe78308b43ada8d2d51d8cc33988" + } + } + } + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/nam/train/__init__.py b/nam/train/__init__.py @@ -0,0 +1,3 @@ +# File: __init__.py +# Created Date: Sunday December 4th 2022 +# Author: Steven Atkinson ([email protected]) diff --git a/nam/train/colab.py b/nam/train/colab.py @@ -0,0 +1,231 @@ +# File: colab.py +# Created Date: Sunday December 4th 2022 +# Author: Steven Atkinson ([email protected]) + +""" +Hide the mess in Colab to make things look pretty for users. +""" + +from pathlib import Path +from time import time +from typing import Optional, Union + +import matplotlib.pyplot as plt +import numpy as np +import pytorch_lightning as pl +import torch +from torch.utils.data import DataLoader + +from nam.data import REQUIRED_RATE, Split, init_dataset, wav_to_np +from nam.models import Model + +_INPUT_BASENAME = "v1.wav" +_OUTPUT_BASENAME = "output.wav" + + +def _check_for_files(): + print("Checking that we have all of the required audio files...") + if not Path(_INPUT_BASENAME).exists(): + raise FileNotFoundError( + f"Didn't find NAM's input audio file. Please upload {_INPUT_BASENAME}" + ) + if not Path(_OUTPUT_BASENAME).exists(): + raise FileNotFoundError( + f"Didn't find your reamped output audio file. Please upload {_OUTPUT_BASENAME}." + ) + + +def _calibrate_delay_v1() -> int: + safety_factor = 4 + # Locations of blips in v1 signal file: + i1, i2 = 12_000, 36_000 + j1_start_looking = i1 - 1_000 + j2_start_looking = i2 - 1_000 + + y = wav_to_np(_OUTPUT_BASENAME)[:48_000] + + background_level = np.max(np.abs(y[:6_000])) + trigger_threshold = background_level + 0.01 + j1 = np.where(np.abs(y[j1_start_looking:j2_start_looking]) > trigger_threshold)[0][ + 0 + ] + j2 = np.where(np.abs(y[j2_start_looking:]) > trigger_threshold)[0][0] + + delay_1 = (j1 + j1_start_looking) - i1 + delay_2 = (j2 + j2_start_looking) - i2 + print(f"Delays: {delay_1}, {delay_2}") + delay = int(np.min([delay_1, delay_2])) - safety_factor + print(f"Final delay is {delay}") + return delay + + +def _calibrate_delay() -> int: + print("Calibrating the delay in your data...") + return _calibrate_delay_v1() + + +def _get_configs(delay: int, epochs: int, stage_1_channels, stage_2_channels): + val_seconds = 9 + train_val_split = -val_seconds * REQUIRED_RATE + data_config = { + "train": {"ny": 8192, "stop": train_val_split}, + "validation": {"ny": None, "start": train_val_split}, + "common": { + "x_path": _INPUT_BASENAME, + "y_path": _OUTPUT_BASENAME, + "delay": delay, + }, + } + model_config = { + "net": { + "name": "WaveNet", + # This should do decently. If you really want a nice model, try turning up + # "channels" in the first block and "input_size" in the second from 12 to 16. + "config": { + "layers_configs": [ + { + "input_size": 1, + "condition_size": 1, + "head_size": stage_2_channels, + "channels": stage_1_channels, + "kernel_size": 3, + "dilations": [1, 2, 4, 8, 16, 32, 64, 128, 256, 512], + "activation": "Tanh", + "gated": False, + "head_bias": False, + }, + { + "input_size": stage_1_channels, + "condition_size": 1, + "head_size": 1, + "channels": stage_2_channels, + "kernel_size": 3, + "dilations": [1, 2, 4, 8, 16, 32, 64, 128, 256, 512], + "activation": "Tanh", + "gated": False, + "head_bias": True, + }, + ] + }, + }, + "loss": {"val_loss": "esr"}, + "optimizer": {"lr": 0.001}, + "lr_scheduler": {"class": "ExponentialLR", "kwargs": {"gamma": 0.993}}, + } + learning_config = { + "train_dataloader": { + "batch_size": 16, + "shuffle": True, + "pin_memory": True, + "drop_last": True, + "num_workers": 0, + }, + "val_dataloader": {}, + "trainer": {"accelerator": "gpu", "devices": 1, "max_epochs": epochs}, + } + return data_config, model_config, learning_config + + +def _esr(pred: torch.Tensor, target: torch.Tensor) -> float: + return ( + torch.mean(torch.square(pred - target)).item() + / torch.mean(torch.square(target)).item() + ) + + +def _plot( + model, ds, window_start: Optional[int] = None, window_end: Optional[int] = None +): + print("Plotting a comparison of your model with the target output...") + with torch.no_grad(): + tx = len(ds.x) / 48_000 + print(f"Run (t={tx:.2f} sec)") + t0 = time() + output = model(ds.x).flatten().cpu().numpy() + t1 = time() + print(f"Took {t1 - t0:.2f} sec ({tx / (t1 - t0):.2f}x)") + + esr = _esr(torch.Tensor(output), ds.y) + # Trying my best to put numbers to it... + if esr < 0.01: + esr_comment = "Great!" + elif esr < 0.035: + esr_comment = "Not bad!" + elif esr < 0.1: + esr_comment = "...This *might* sound ok!" + elif esr < 0.3: + esr_comment = "...This probably won't sound great :(" + else: + esr_comment = "...Something seems to have gone wrong." + print(f"Error-signal ratio = {esr:.3f}") + print(esr_comment) + + plt.figure(figsize=(16, 5)) + plt.plot(output[window_start:window_end], label="Prediction") + plt.plot(ds.y[window_start:window_end], linestyle="--", label="Target") + plt.title(f"ESR={esr:.3f}") + plt.legend() + + +def _get_valid_export_directory(): + def get_path(version): + return Path("exported_models", f"version_{version}") + + version = 1 + while get_path(version).exists(): + version += 1 + return get_path(version) + + +def run(epochs=100, stage_1_channels=16, stage_2_channels=8): + _check_for_files() + delay = _calibrate_delay() + data_config, model_config, learning_config = _get_configs( + delay, epochs, stage_1_channels, stage_2_channels + ) + + print("Starting training. Let's rock!") + model = Model.init_from_config(model_config) + data_config["common"]["nx"] = model.net.receptive_field + dataset_train = init_dataset(data_config, Split.TRAIN) + dataset_validation = init_dataset(data_config, Split.VALIDATION) + train_dataloader = DataLoader(dataset_train, **learning_config["train_dataloader"]) + val_dataloader = DataLoader(dataset_validation, **learning_config["val_dataloader"]) + + trainer = pl.Trainer( + callbacks=[ + pl.callbacks.model_checkpoint.ModelCheckpoint( + filename="checkpoint_best_{epoch:04d}_{step}_{ESR:.4f}_{MSE:.3e}", + save_top_k=3, + monitor="val_loss", + every_n_epochs=1, + ), + pl.callbacks.model_checkpoint.ModelCheckpoint( + filename="checkpoint_last_{epoch:04d}_{step}", every_n_epochs=1 + ), + ], + **learning_config["trainer"], + ) + trainer.fit(model, train_dataloader, val_dataloader) + + # Go to best checkpoint + best_checkpoint = trainer.checkpoint_callback.best_model_path + if best_checkpoint != "": + model = Model.load_from_checkpoint( + trainer.checkpoint_callback.best_model_path, + **Model.parse_config(model_config), + ) + model.eval() + + _plot( + model, + dataset_validation, + window_start=100_000, # Start of the plotting window, in samples + window_end=101_000, # End of the plotting window, in samples + ) + + print("Exporting your model...") + model_export_outdir = _get_valid_export_directory() + model_export_outdir.mkdir(parents=True, exist_ok=False) + model.net.export(model_export_outdir) + print(f"Model exported to {model_export_outdir}. Enjoy!")