Skip to content

Commit

Permalink
fix: update requirements and use the default device in the tutorials;
Browse files Browse the repository at this point in the history
  • Loading branch information
WenjieDu committed Mar 18, 2024
1 parent 9028c56 commit 831ac32
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 39 deletions.
15 changes: 6 additions & 9 deletions PyPOTS_Classification.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
" num_workers=0,\n",
" # just leave it to default as None, PyPOTS will automatically assign the best device for you.\n",
" # Set it as 'cpu' if you don't have CUDA devices. You can also set it to 'cuda:0' or 'cuda:1' if you have multiple CUDA devices, even parallelly on ['cuda:0', 'cuda:1']\n",
" device='cuda', \n",
" device=None, \n",
" # set the path for saving tensorboard and trained model files \n",
" saving_path=\"tutorial_results/classification/raindrop\",\n",
" model_saving_strategy=\"best\", # only save the best model after training finished. \n",
Expand Down Expand Up @@ -196,8 +196,7 @@
"PR_AUC: 0.4184412610743794,\n",
"F1: 0.41390205371248023,\n",
"Precision: 0.447098976109215,\n",
"Recall: 0.38529411764705884,\n",
"\n"
"Recall: 0.38529411764705884,\n"
]
}
],
Expand Down Expand Up @@ -263,7 +262,7 @@
" num_workers=0,\n",
" # just leave it to default as None, PyPOTS will automatically assign the best device for you.\n",
" # Set it as 'cpu' if you don't have CUDA devices. You can also set it to 'cuda:0' or 'cuda:1' if you have multiple CUDA devices, even parallelly on ['cuda:0', 'cuda:1']\n",
" device='cuda', \n",
" device=None, \n",
" # set the path for saving tensorboard and trained model files \n",
" saving_path=\"tutorial_results/classification/brits\",\n",
" # only save the best model after training finished.\n",
Expand Down Expand Up @@ -326,8 +325,7 @@
"PR_AUC: 0.40568596808086554,\n",
"F1: 0.3706293706293706,\n",
"Precision: 0.45689655172413796,\n",
"Recall: 0.31176470588235294,\n",
"\n"
"Recall: 0.31176470588235294,\n"
]
}
],
Expand Down Expand Up @@ -393,7 +391,7 @@
" num_workers=0,\n",
" # just leave it to default as None, PyPOTS will automatically assign the best device for you.\n",
" # Set it as 'cpu' if you don't have CUDA devices. You can also set it to 'cuda:0' or 'cuda:1' if you have multiple CUDA devices, even parallelly on ['cuda:0', 'cuda:1']\n",
" device='cuda', \n",
" device=None, \n",
" # set the path for saving tensorboard and trained model files \n",
" saving_path=\"tutorial_results/classification/grud\",\n",
" # only save the best model after training finished.\n",
Expand Down Expand Up @@ -455,8 +453,7 @@
"PR_AUC: 0.48160561802559804,\n",
"F1: 0.41064638783269963,\n",
"Precision: 0.5806451612903226,\n",
"Recall: 0.3176470588235294,\n",
"\n"
"Recall: 0.3176470588235294,\n"
]
}
],
Expand Down
10 changes: 4 additions & 6 deletions PyPOTS_Clustering.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
" num_workers=0,\n",
" # just leave it to default as None, PyPOTS will automatically assign the best device for you.\n",
" # Set it as 'cpu' if you don't have CUDA devices. You can also set it to 'cuda:0' or 'cuda:1' if you have multiple CUDA devices, even parallelly on ['cuda:0', 'cuda:1']\n",
" device='cuda', \n",
" device=None, \n",
" # set the path for saving tensorboard and trained model files \n",
" saving_path=\"tutorial_results/clustering/crli\",\n",
" # only save the best model after training finished.\n",
Expand Down Expand Up @@ -186,8 +186,7 @@
"text": [
"Testing clustering metrics: \n",
"RI: 0.6352735191995277, \n",
"CP: 0.8582151793160967\n",
"\n"
"CP: 0.8582151793160967\n"
]
}
],
Expand Down Expand Up @@ -254,7 +253,7 @@
" num_workers=0,\n",
" # just leave it to default as None, PyPOTS will automatically assign the best device for you.\n",
" # Set it as 'cpu' if you don't have CUDA devices. You can also set it to 'cuda:0' or 'cuda:1' if you have multiple CUDA devices, even parallelly on ['cuda:0', 'cuda:1']\n",
" device='cuda', \n",
" device=None, \n",
" # set the path for saving tensorboard and trained model files \n",
" saving_path=\"tutorial_results/clustering/vader\",\n",
" # only save the best model after training finished.\n",
Expand Down Expand Up @@ -314,8 +313,7 @@
"text": [
"Testing clustering metrics: \n",
"RI: 0.7565347009032349, \n",
"CP: 0.8582151793160967,\n",
"\n"
"CP: 0.8582151793160967,\n"
]
}
],
Expand Down
32 changes: 10 additions & 22 deletions PyPOTS_Imputation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
" num_workers=0,\n",
" # just leave it to default as None, PyPOTS will automatically assign the best device for you.\n",
" # Set it as 'cpu' if you don't have CUDA devices. You can also set it to 'cuda:0' or 'cuda:1' if you have multiple CUDA devices, even parallelly on ['cuda:0', 'cuda:1']\n",
" device='cuda', \n",
" device=None, \n",
" # set the path for saving tensorboard and trained model files \n",
" saving_path=\"tutorial_results/imputation/saits\",\n",
" # only save the best model after training finished.\n",
Expand Down Expand Up @@ -269,7 +269,7 @@
" num_workers=0,\n",
" # just leave it to default as None, PyPOTS will automatically assign the best device for you.\n",
" # Set it as 'cpu' if you don't have CUDA devices. You can also set it to 'cuda:0' or 'cuda:1' if you have multiple CUDA devices, even parallelly on ['cuda:0', 'cuda:1']\n",
" device='cuda', \n",
" device=None, \n",
" # set the path for saving tensorboard and trained model files \n",
" saving_path=\"tutorial_results/imputation/transformer\",\n",
" # only save the best model after training finished.\n",
Expand Down Expand Up @@ -399,7 +399,7 @@
" num_workers=0,\n",
" # just leave it to default as None, PyPOTS will automatically assign the best device for you.\n",
" # Set it as 'cpu' if you don't have CUDA devices. You can also set it to 'cuda:0' or 'cuda:1' if you have multiple CUDA devices, even parallelly on ['cuda:0', 'cuda:1']\n",
" device='cuda', \n",
" device=None, \n",
" # set the path for saving tensorboard and trained model files \n",
" saving_path=\"tutorial_results/imputation/timesnet\",\n",
" # only save the best model after training finished.\n",
Expand Down Expand Up @@ -675,7 +675,7 @@
" num_workers=0,\n",
" # just leave it to default as None, PyPOTS will automatically assign the best device for you.\n",
" # Set it as 'cpu' if you don't have CUDA devices. You can also set it to 'cuda:0' or 'cuda:1' if you have multiple CUDA devices, even parallelly on ['cuda:0', 'cuda:1']\n",
" device='cuda',\n",
" device=None,\n",
" # set the path for saving tensorboard and trained model files \n",
" saving_path=\"tutorial_results/imputation/us_gan\",\n",
" # only save the best model after training finished.\n",
Expand Down Expand Up @@ -809,7 +809,7 @@
" num_workers=0,\n",
" # just leave it to default as None, PyPOTS will automatically assign the best device for you.\n",
" # Set it as 'cpu' if you don't have CUDA devices. You can also set it to 'cuda:0' or 'cuda:1' if you have multiple CUDA devices, even parallelly on ['cuda:0', 'cuda:1']\n",
" device='cuda', \n",
" device=None, \n",
" # set the path for saving tensorboard and trained model files \n",
" saving_path=\"tutorial_results/imputation/gp_vae\",\n",
" # only save the best model after training finished.\n",
Expand Down Expand Up @@ -945,7 +945,7 @@
" num_workers=0,\n",
" # just leave it to default as None, PyPOTS will automatically assign the best device for you.\n",
" # Set it as 'cpu' if you don't have CUDA devices. You can also set it to 'cuda:0' or 'cuda:1' if you have multiple CUDA devices, even parallelly on ['cuda:0', 'cuda:1']\n",
" device='cuda',\n",
" device=None,\n",
" # set the path for saving tensorboard and trained model files \n",
" saving_path=\"tutorial_results/imputation/brits\", \n",
" # only save the best model after training finished.\n",
Expand Down Expand Up @@ -1030,10 +1030,7 @@
"cell_type": "code",
"execution_count": 32,
"metadata": {
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
"collapsed": false
},
"outputs": [
{
Expand Down Expand Up @@ -1086,10 +1083,7 @@
"cell_type": "code",
"execution_count": 33,
"metadata": {
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
"collapsed": false
},
"outputs": [
{
Expand Down Expand Up @@ -1119,10 +1113,7 @@
"cell_type": "code",
"execution_count": 34,
"metadata": {
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
"collapsed": false
},
"outputs": [],
"source": [
Expand All @@ -1135,10 +1126,7 @@
"cell_type": "code",
"execution_count": 35,
"metadata": {
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
"collapsed": false
},
"outputs": [
{
Expand Down
4 changes: 2 additions & 2 deletions conda-environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ dependencies:
- conda-forge::tsdb
- conda-forge::protobuf <=4.21.12
- pytorch::pytorch >=1.10.0
- conda-forge::pypots >=0.1.1
- conda-forge::pypots >=0.3.1
- conda-forge::tsdb
- conda-forge::pycorruptor
- conda-forge::pygrinder
- conda-forge::jupyterlab

# optional
Expand Down

0 comments on commit 831ac32

Please sign in to comment.