Skip to content

Commit

Permalink
Change name to LSTM_pytorch
Browse files Browse the repository at this point in the history
  • Loading branch information
hkair committed Sep 15, 2020
1 parent 4b5f4b5 commit 6ae86df
Show file tree
Hide file tree
Showing 7 changed files with 243 additions and 1,230 deletions.
832 changes: 0 additions & 832 deletions .ipynb_checkpoints/EMG_lstm-checkpoint.ipynb

This file was deleted.

186 changes: 106 additions & 80 deletions Data Analysis.ipynb

Large diffs are not rendered by default.

339 changes: 40 additions & 299 deletions LSTM_keras.ipynb

Large diffs are not rendered by default.

9 changes: 1 addition & 8 deletions EMG_lstm.ipynb → LSTM_pytorch.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -499,13 +499,6 @@
" print ('Epoch [{}/{}], Step [{}/{}], Loss: {:.4f}' \n",
" .format(epoch+1, num_epochs, i+1, total_step, loss.item()))"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand All @@ -524,7 +517,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.5"
"version": "3.8.5"
}
},
"nbformat": 4,
Expand Down
3 changes: 1 addition & 2 deletions model_train.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
time_steps = input_array.shape[1]
n_features = input_array.shape[2]

# code for building an LSTM with 100 neurons and dropout.
# LSTM with 100 neurons and dropout.

model = Sequential()
model.add(LSTM(100, return_sequences=False, input_shape=(time_steps, n_features)))
Expand Down Expand Up @@ -82,6 +82,5 @@
print(abnormal_onehot_encoded)

# test on abnormal dataset

score = model.evaluate(abnormal_input_array, abnormal_onehot_encoded, batch_size=16)
print(score)
9 changes: 0 additions & 9 deletions preprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,50 +29,42 @@ def __init__(self, path):
self.dataframe = pd.DataFrame(self.array, columns=['RF','BF','VM','ST','FX'])

def return_array(self):

return self.array

def return_df(self):

return self.dataframe

def return_output(self):
return self.output

def plot_RF(self):

plt.plot(self.dataframe['RF'])
plt.title('RF - rectus femoris')
plt.show()

def plot_BF(self):

plt.plot(self.dataframe['BF'])
plt.title('BF - biceps femoris')
plt.show()

def plot_VM(self):

plt.plot(self.dataframe['VM'])
plt.title('VM - vastus internus')
plt.show()

def plot_ST(self):

plt.plot(self.dataframe['ST'])
plt.title('ST - semitendinosus')
plt.show()

def plot_FX(self):

plt.plot(self.dataframe['FX'])
plt.title('FX - knee flexion ()')
plt.show()

def sEMG_plot(self):

# Plot individual sEMG data

plt.plot(self.dataframe['RF'])
plt.title('RF - rectus femoris')
plt.show()
Expand All @@ -96,7 +88,6 @@ def sEMG_plot(self):
# Preprocessing Function

def preprocess(folder):

input_array = []
classes = []

Expand Down
95 changes: 95 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
absl-py==0.10.0
appnope==0.1.0
argon2-cffi==20.1.0
astunparse==1.6.3
async-generator==1.10
attrs==20.2.0
backcall==0.2.0
bleach==3.1.5
cachetools==4.1.1
certifi==2020.6.20
cffi==1.14.2
chardet==3.0.4
cycler==0.10.0
decorator==4.4.2
defusedxml==0.6.0
entrypoints==0.3
gast==0.3.3
google-auth==1.21.1
google-auth-oauthlib==0.4.1
google-pasta==0.2.0
grpcio==1.32.0
h5py==2.10.0
idna==2.10
ipykernel==5.3.4
ipython==7.18.1
ipython-genutils==0.2.0
jedi==0.17.2
Jinja2==2.11.2
joblib==0.16.0
json5==0.9.5
jsonschema==3.2.0
jupyter-client==6.1.7
jupyter-core==4.6.3
jupyterlab==2.2.8
jupyterlab-pygments==0.1.1
jupyterlab-server==1.2.0
Keras==2.4.3
Keras-Preprocessing==1.1.2
kiwisolver==1.2.0
Markdown==3.2.2
MarkupSafe==1.1.1
matplotlib==3.3.1
mistune==0.8.4
nbclient==0.5.0
nbconvert==6.0.2
nbformat==5.0.7
nest-asyncio==1.4.0
notebook==6.1.4
numpy==1.18.5
oauthlib==3.1.0
opt-einsum==3.3.0
packaging==20.4
pandas==1.1.2
pandocfilters==1.4.2
parso==0.7.1
pexpect==4.8.0
pickleshare==0.7.5
Pillow==7.2.0
prometheus-client==0.8.0
prompt-toolkit==3.0.7
protobuf==3.13.0
ptyprocess==0.6.0
pyasn1==0.4.8
pyasn1-modules==0.2.8
pycparser==2.20
Pygments==2.7.0
pyparsing==2.4.7
pyrsistent==0.17.3
python-dateutil==2.8.1
pytz==2020.1
PyYAML==5.3.1
pyzmq==19.0.2
requests==2.24.0
requests-oauthlib==1.3.0
rsa==4.6
scikit-learn==0.23.2
scipy==1.4.1
Send2Trash==1.5.0
six==1.15.0
sklearn==0.0
tensorboard==2.3.0
tensorboard-plugin-wit==1.7.0
tensorflow==2.3.0
tensorflow-estimator==2.3.0
termcolor==1.1.0
terminado==0.8.3
testpath==0.4.4
threadpoolctl==2.1.0
tornado==6.0.4
traitlets==5.0.4
urllib3==1.25.10
wcwidth==0.2.5
webencodings==0.5.1
Werkzeug==1.0.1
wrapt==1.12.1

0 comments on commit 6ae86df

Please sign in to comment.