Skip to content

Commit

Permalink
works with gestureRNN example
Browse files Browse the repository at this point in the history
  • Loading branch information
cpmpercussion committed Sep 10, 2024
1 parent 41c5bb4 commit 4505252
Show file tree
Hide file tree
Showing 3 changed files with 220 additions and 14 deletions.
18 changes: 5 additions & 13 deletions notebooks/4-gesture-rnn.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,10 @@
"metadata": {},
"outputs": [],
"source": [
"from __future__ import print_function\n",
"import os\n",
"import time\n",
"import pandas as pd\n",
"import numpy as np\n",
"import tensorflow as tf\n",
"import time\n",
"import os\n",
"import datetime\n",
"import pickle\n",
"import matplotlib.pyplot as plt\n",
"import random\n",
"from itertools import permutations\n",
"\n",
"import urllib.request\n",
Expand All @@ -59,7 +51,7 @@
"vocabulary_size = len(GESTURE_CODES)\n",
"\n",
"print(\"Here's an example of some gestures from a trio performance:\")\n",
"metatone_dataset.gestures.ix[0][:20].T"
"metatone_dataset.gestures.iloc[0][:20].T"
]
},
{
Expand All @@ -80,7 +72,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -283,12 +275,12 @@
"num_output_classes = vocabulary_size ** num_output_performers\n",
"\n",
"training_model = keras.models.Sequential()\n",
"training_model.add(keras.layers.Embedding(num_input_classes, num_units, input_length=num_steps))\n",
"training_model.add(keras.Input(shape=(num_input_classes,)))\n",
"training_model.add(keras.layers.Embedding(num_input_classes, num_units))\n",
"for n in range(num_layers - 1):\n",
" training_model.add(keras.layers.LSTM(num_units, return_sequences=True))\n",
"training_model.add(keras.layers.LSTM(num_units))\n",
"training_model.add(keras.layers.Dense(num_output_classes, activation='softmax'))\n",
"# model.add(Activation('softmax'))\n",
"\n",
"training_model.compile(loss='sparse_categorical_crossentropy', optimizer='Adam')\n",
"training_model.summary()\n",
Expand Down Expand Up @@ -354,7 +346,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.5"
"version": "3.12.5"
}
},
"nbformat": 4,
Expand Down
Loading

0 comments on commit 4505252

Please sign in to comment.