From ab322871d34b8b8e0e2517889cc54581fd0e868c Mon Sep 17 00:00:00 2001 From: Charles Martin Date: Fri, 7 Jun 2024 17:05:53 +1000 Subject: [PATCH] updated notebooks a bit so that everything works as expected --- notebooks/MDN-RNN-RoboJam-touch-generation.ipynb | 13 ++++++------- notebooks/MDN-RNN-kanji-generation-example.ipynb | 12 ++++++------ .../MDN-RNN-time-distributed-MDN-training.ipynb | 8 ++++---- 3 files changed, 16 insertions(+), 17 deletions(-) diff --git a/notebooks/MDN-RNN-RoboJam-touch-generation.ipynb b/notebooks/MDN-RNN-RoboJam-touch-generation.ipynb index 4738d32..1f98ef5 100644 --- a/notebooks/MDN-RNN-RoboJam-touch-generation.ipynb +++ b/notebooks/MDN-RNN-RoboJam-touch-generation.ipynb @@ -46,13 +46,12 @@ "import time\n", "import pandas as pd\n", "from context import * # imports MDN\n", - "%matplotlib inline\n", + "%matplotlib widget\n", "import matplotlib.pyplot as plt\n", "\n", "\n", "input_colour = 'darkblue'\n", - "gen_colour = 'firebrick'\n", - "plt.style.use('seaborn-talk')" + "gen_colour = 'firebrick'" ] }, { @@ -88,7 +87,7 @@ "source": [ "# Download microjam performance data if needed.\n", "import urllib.request\n", - "url = 'http://folk.uio.no/charlepm/datasets/TinyPerformanceCorpus.h5'\n", + "url = 'https://github.com/cpmpercussion/creative-prediction-datasets/raw/main/datasets/TinyPerformanceCorpus.h5'\n", "urllib.request.urlretrieve(url, './TinyPerformanceCorpus.h5') " ] }, @@ -536,7 +535,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -550,9 +549,9 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.7.4" + "version": "3.11.3" } }, "nbformat": 4, - "nbformat_minor": 2 + "nbformat_minor": 4 } diff --git a/notebooks/MDN-RNN-kanji-generation-example.ipynb b/notebooks/MDN-RNN-kanji-generation-example.ipynb index 8e95708..d4dd840 100644 --- a/notebooks/MDN-RNN-kanji-generation-example.ipynb +++ b/notebooks/MDN-RNN-kanji-generation-example.ipynb @@ -36,11 +36,11 @@ "source": [ "from context import * # imports the MDN layer \n", "import numpy as np\n", + "import pandas as pd\n", "import random\n", "import matplotlib.pyplot as plt\n", "from mpl_toolkits.mplot3d import Axes3D \n", - "%matplotlib inline\n", - "import pandas as pd\n", + "%matplotlib widget\n", "\n", "# Only for GPU use:\n", "#import os\n", @@ -235,7 +235,7 @@ "model.add(mdn.MDN(OUTPUT_DIMENSION, NUMBER_MIXTURES))\n", "\n", "# Now we compile the MDN RNN - need to use a special loss function with the right number of dimensions and mixtures.\n", - "model.compile(loss=mdn.get_mixture_loss_func(OUTPUT_DIMENSION,NUMBER_MIXTURES), optimizer=keras.optimizers.Adam())\n", + "model.compile(loss=mdn.get_mixture_loss_func(OUTPUT_DIMENSION,NUMBER_MIXTURES), optimizer=keras.optimizers.legacy.Adam())\n", "\n", "# Let's see what we have:\n", "model.summary()" @@ -509,7 +509,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -523,9 +523,9 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.7.4" + "version": "3.11.3" } }, "nbformat": 4, - "nbformat_minor": 2 + "nbformat_minor": 4 } diff --git a/notebooks/MDN-RNN-time-distributed-MDN-training.ipynb b/notebooks/MDN-RNN-time-distributed-MDN-training.ipynb index 11735ad..029cc2d 100644 --- a/notebooks/MDN-RNN-time-distributed-MDN-training.ipynb +++ b/notebooks/MDN-RNN-time-distributed-MDN-training.ipynb @@ -24,7 +24,7 @@ "import random\n", "import matplotlib.pyplot as plt\n", "from mpl_toolkits.mplot3d import Axes3D \n", - "%matplotlib inline\n", + "%matplotlib widget\n", "\n", "# Only for GPU use:\n", "import os\n", @@ -419,7 +419,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -433,9 +433,9 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.7.4" + "version": "3.11.3" } }, "nbformat": 4, - "nbformat_minor": 2 + "nbformat_minor": 4 }