Skip to content

Commit

Permalink
updated notebooks a bit so that everything works as expected
Browse files Browse the repository at this point in the history
  • Loading branch information
cpmpercussion committed Jun 7, 2024
1 parent 68992ab commit ab32287
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 17 deletions.
13 changes: 6 additions & 7 deletions notebooks/MDN-RNN-RoboJam-touch-generation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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'"
]
},
{
Expand Down Expand Up @@ -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') "
]
},
Expand Down Expand Up @@ -536,7 +535,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -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
}
12 changes: 6 additions & 6 deletions notebooks/MDN-RNN-kanji-generation-example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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()"
Expand Down Expand Up @@ -509,7 +509,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -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
}
8 changes: 4 additions & 4 deletions notebooks/MDN-RNN-time-distributed-MDN-training.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -419,7 +419,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -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
}

0 comments on commit ab32287

Please sign in to comment.