Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
LinglongQian committed May 21, 2024
1 parent a96be8a commit fae3f60
Showing 1 changed file with 37 additions and 18 deletions.
55 changes: 37 additions & 18 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:0', \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:0', \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 @@ -398,7 +398,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:0',\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 @@ -530,7 +530,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:0',\n",
" device=None,\n",
" # set the path for saving tensorboard and trained model files \n",
" saving_path=\"tutorial_results/imputation/csdi\",\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:0',\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 @@ -808,7 +808,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:0',\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 @@ -944,7 +944,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:0',\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 @@ -1070,7 +1070,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:0',\n",
" device=None,\n",
" # set the path for saving tensorboard and trained model files\n",
" saving_path=\"tutorial_results/imputation/mrnn\",\n",
" # only save the best model after training finished.\n",
Expand All @@ -1085,15 +1085,34 @@
"metadata": {
"collapsed": false
},
"outputs": [],
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"2024-05-21 14:10:33 [INFO]: Epoch 001 - training loss: 0.7347, validation loss: 0.9286\n",
"2024-05-21 14:10:57 [INFO]: Epoch 002 - training loss: 0.5278, validation loss: 0.8844\n",
"2024-05-21 14:11:18 [INFO]: Epoch 003 - training loss: 0.4864, validation loss: 0.8717\n",
"2024-05-21 14:11:42 [INFO]: Epoch 004 - training loss: 0.4697, validation loss: 0.8623\n",
"2024-05-21 14:12:12 [INFO]: Epoch 005 - training loss: 0.4615, validation loss: 0.8596\n",
"2024-05-21 14:12:41 [INFO]: Epoch 006 - training loss: 0.4405, validation loss: 0.8583\n",
"2024-05-21 14:13:01 [INFO]: Epoch 007 - training loss: 0.4361, validation loss: 0.8600\n",
"2024-05-21 14:13:23 [INFO]: Epoch 008 - training loss: 0.4315, validation loss: 0.8633\n",
"2024-05-21 14:13:45 [INFO]: Epoch 009 - training loss: 0.4296, validation loss: 0.8660\n",
"2024-05-21 14:13:45 [INFO]: Exceeded the training patience. Terminating the training procedure...\n",
"2024-05-21 14:13:45 [INFO]: Finished training. The best model is from epoch#6.\n",
"2024-05-21 14:13:45 [INFO]: Saved the model to tutorial_results/imputation/mrnn/20240521_T140950/MRNN.pypots\n"
]
}
],
"source": [
"# train the model on the training set, and validate it on the validating set to select the best model for testing in the next step\n",
"mrnn.fit(train_set=dataset_for_training, val_set=dataset_for_validating)\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 35,
"metadata": {
"collapsed": false
},
Expand All @@ -1106,7 +1125,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 36,
"metadata": {
"collapsed": false
},
Expand All @@ -1115,7 +1134,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Testing mean absolute error: 0.6825\n"
"Testing mean absolute error: 0.6776\n"
]
}
],
Expand All @@ -1140,14 +1159,14 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 37,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"2024-03-17 23:40:47 [INFO]: No given device, using default device: cuda\n"
"2024-05-21 14:13:51 [INFO]: No given device, using default device: cuda\n"
]
}
],
Expand All @@ -1160,14 +1179,14 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 38,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/wdudu/.conda/envs/ml/lib/python3.10/site-packages/pypots/imputation/locf/model.py:67: UserWarning: LOCF (Last Observed Carried Forward) imputation class has no parameter to train. Please run func `predict()` directly.\n",
"/home/linglong/data/linglong/.conda/envs/pypots-dev/lib/python3.11/site-packages/pypots/imputation/locf/model.py:67: UserWarning: LOCF (Last Observed Carried Forward) imputation class has no parameter to train. Please run func `predict()` directly.\n",
" warnings.warn(\n"
]
}
Expand All @@ -1180,7 +1199,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 39,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -1191,7 +1210,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 40,
"metadata": {},
"outputs": [
{
Expand Down

0 comments on commit fae3f60

Please sign in to comment.