notebook updates for colab

This commit is contained in:
NT
2021-09-08 09:59:55 +02:00
parent 7156d68483
commit 73ec4d1155
3 changed files with 186 additions and 110 deletions

View File

@@ -443,6 +443,7 @@
"vels = np.concatenate(vels, axis=-1) \n",
"\n",
"# save for comparison with other methods\n",
"import os; os.makedirs(\"./temp\",exist_ok=True)\n",
"np.savez_compressed(\"./temp/burgers-diffphys-solution.npz\", np.reshape(vels,[N,STEPS+1])) # remove batch & channel dimension\n",
"\n",
"show_state(vels)"
@@ -454,7 +455,7 @@
"source": [
"## Physics-informed vs. differentiable physics reconstruction\n",
"\n",
"Now we have both versions, the one with the PINN, and the DP version, so let's compare both reconstructions in more detail.\n",
"Now we have both versions, the one with the PINN, and the DP version, so let's compare both reconstructions in more detail. (Note: The following cells expect that the Burgers-forward and PINN notebooks were executed in the same environment beforehand.)\n",
"\n",
"Let's first look at the solutions side by side. The code below generates an image with 3 versions, from top to bottom: the \"ground truth\" (GT) solution as given by the regular forward simulation, in the middle the PINN reconstruction, and at the bottom the differentiable physics version.\n"
]
@@ -486,7 +487,7 @@
}
],
"source": [
"# note, this requires running the forward sim & PINN notebooks beforehand\n",
"# note, this requires previous runs of the forward-sim & PINN notebooks in the same environment\n",
"sol_gt=npfile=np.load(\"./temp/burgers-groundtruth-solution.npz\")[\"arr_0\"] \n",
"sol_pi=npfile=np.load(\"./temp/burgers-pinn-solution.npz\")[\"arr_0\"] \n",
"sol_dp=npfile=np.load(\"./temp/burgers-diffphys-solution.npz\")[\"arr_0\"] \n",

File diff suppressed because one or more lines are too long

View File

@@ -51,7 +51,7 @@
},
"outputs": [],
"source": [
"!pip install stable-baselines3==1.0 phiflow==1.5.1\n",
"!pip install stable-baselines3==1.1 phiflow==1.5.1\n",
"!git clone https://github.com/Sh0cktr4p/PDE-Control-RL.git\n",
"!git clone https://github.com/holl-/PDE-Control.git"
]
@@ -1291,4 +1291,4 @@
},
"nbformat": 4,
"nbformat_minor": 0
}
}