Last active
June 17, 2020 03:39
-
-
Save derkzomer/b2529236a91e1b918a91578af9daeef4 to your computer and use it in GitHub Desktop.
This file contains 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": 21, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"model = Sequential()" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 22, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"Epoch 1/10\n", | |
"26538/26538 [==============================] - 106s 4ms/step - loss: 0.0326\n", | |
"Epoch 2/10\n", | |
"26538/26538 [==============================] - 96s 4ms/step - loss: 0.0250\n", | |
"Epoch 3/10\n", | |
"26538/26538 [==============================] - 97s 4ms/step - loss: 0.0229\n", | |
"Epoch 4/10\n", | |
"26538/26538 [==============================] - 97s 4ms/step - loss: 0.0223\n", | |
"Epoch 5/10\n", | |
"26538/26538 [==============================] - 97s 4ms/step - loss: 0.0221\n", | |
"Epoch 6/10\n", | |
"26538/26538 [==============================] - 97s 4ms/step - loss: 0.0219\n", | |
"Epoch 7/10\n", | |
"26538/26538 [==============================] - 96s 4ms/step - loss: 0.0217\n", | |
"Epoch 8/10\n", | |
"26538/26538 [==============================] - 98s 4ms/step - loss: 0.0217\n", | |
"Epoch 9/10\n", | |
"26538/26538 [==============================] - 98s 4ms/step - loss: 0.0216\n", | |
"Epoch 10/10\n", | |
"26538/26538 [==============================] - 100s 4ms/step - loss: 0.0216\n", | |
"Saved model to disk\n" | |
] | |
} | |
], | |
"source": [ | |
"epochs = 10\n", | |
"\n", | |
"model.add(LSTM(units=50, return_sequences = True, input_shape = (x_train.shape[1],9)))\n", | |
"model.add(Dropout(0.2))\n", | |
"model.add(LSTM(units=50, return_sequences = True))\n", | |
"model.add(Dropout(0.2))\n", | |
"model.add(LSTM(units=50, return_sequences = True))\n", | |
"model.add(Dropout(0.2))\n", | |
"model.add(LSTM(units=50))\n", | |
"model.add(Dropout(0.2))\n", | |
"model.add(Dense(units=9))\n", | |
"model.compile(loss=\"mse\", optimizer=\"adam\")\n", | |
"model.fit(x_train, y_train, batch_size = 32, epochs = epochs)\n", | |
"model.summary\n", | |
"\n", | |
"model.save(\"multiple_features_\"+str(steps)+\"_steps_\"+str(epochs)+\"_epochs.h5\")\n", | |
"print(\"Saved model to disk\")" | |
] | |
} | |
], | |
"metadata": { | |
"kernelspec": { | |
"display_name": "Python 3", | |
"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.7.7" | |
} | |
}, | |
"nbformat": 4, | |
"nbformat_minor": 2 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment