check on Colab option
This commit is contained in:
@@ -24,6 +24,10 @@ operations.
|
||||
IN_COLAB = False
|
||||
if IN_COLAB:
|
||||
!pip install "pina-mathlab"
|
||||
!mkdir "data"
|
||||
!wget "https://github.com/mathLab/PINA/raw/refs/heads/master/tutorials/tutorial10/data/Data_KS.mat" -O "data/Data_KS.mat"
|
||||
!wget "https://github.com/mathLab/PINA/raw/refs/heads/master/tutorials/tutorial10/data/Data_KS2.mat" -O "data/Data_KS2.mat"
|
||||
|
||||
|
||||
import torch
|
||||
import matplotlib.pyplot as plt
|
||||
|
||||
@@ -24,7 +24,7 @@ First of all we import the modules needed for the tutorial. Importing
|
||||
!pip install "pina-mathlab"
|
||||
!pip install scipy
|
||||
# get the data
|
||||
!wget https://github.com/mathLab/PINA/blob/master/tutorials/tutorial5/Data_Darcy.mat
|
||||
!wget https://github.com/mathLab/PINA/raw/refs/heads/master/tutorials/tutorial5/Data_Darcy.mat
|
||||
|
||||
|
||||
# !pip install scipy # install scipy
|
||||
|
||||
@@ -48,8 +48,8 @@ In order to achieve both the goals we will need to define an
|
||||
!pip install "pina-mathlab"
|
||||
# get the data
|
||||
!mkdir "data"
|
||||
!wget "https://github.com/mathLab/PINA/blob/master/tutorials/tutorial7/data/pinn_solution_0.5_0.5" -O "data/pinn_solution_0.5_0.5"
|
||||
!wget "https://github.com/mathLab/PINA/blob/master/tutorials/tutorial7/data/pts_0.5_0.5" -O "data/pts_0.5_0.5"
|
||||
!wget "https://github.com/mathLab/PINA/raw/refs/heads/master/tutorials/tutorial7/data/pinn_solution_0.5_0.5" -O "data/pinn_solution_0.5_0.5"
|
||||
!wget "https://github.com/mathLab/PINA/raw/refs/heads/master/tutorials/tutorial7/data/pts_0.5_0.5" -O "data/pts_0.5_0.5"
|
||||
|
||||
|
||||
import matplotlib.pyplot as plt
|
||||
|
||||
6
tutorials/tutorial10/tutorial.ipynb
vendored
6
tutorials/tutorial10/tutorial.ipynb
vendored
@@ -33,8 +33,8 @@
|
||||
" !pip install \"pina-mathlab\"\n",
|
||||
" # get the data\n",
|
||||
" !mkdir \"data\"\n",
|
||||
" !wget \"https://github.com/mathLab/PINA/blob/master/tutorials/tutorial10/dat/Data_KS.mat\" -O \"data/Data_KS.mat\"\n",
|
||||
" !wget \"https://github.com/mathLab/PINA/blob/master/tutorials/tutorial10/dat/Data_KS2.mat\" -O \"data/Data_KS2.mat\"\n",
|
||||
" !wget \"https://github.com/mathLab/PINA/raw/refs/heads/master/tutorials/tutorial10/data/Data_KS.mat\" -O \"data/Data_KS.mat\"\n",
|
||||
" !wget \"https://github.com/mathLab/PINA/raw/refs/heads/master/tutorials/tutorial10/data/Data_KS2.mat\" -O \"data/Data_KS2.mat\"\n",
|
||||
"\n",
|
||||
"import torch\n",
|
||||
"import matplotlib.pyplot as plt\n",
|
||||
@@ -104,7 +104,7 @@
|
||||
],
|
||||
"source": [
|
||||
"# load data\n",
|
||||
"data=io.loadmat(\"dat/Data_KS.mat\")\n",
|
||||
"data=io.loadmat(\"data/Data_KS.mat\")\n",
|
||||
"\n",
|
||||
"# converting to label tensor\n",
|
||||
"initial_cond_train = LabelTensor(torch.tensor(data['initial_cond_train'], dtype=torch.float), ['t','x','u0'])\n",
|
||||
|
||||
4
tutorials/tutorial10/tutorial.py
vendored
4
tutorials/tutorial10/tutorial.py
vendored
@@ -27,8 +27,8 @@ if IN_COLAB:
|
||||
get_ipython().system('pip install "pina-mathlab"')
|
||||
# get the data
|
||||
get_ipython().system('mkdir "data"')
|
||||
get_ipython().system('wget "https://github.com/mathLab/PINA/blob/master/tutorials/tutorial10/dat/Data_KS.mat" -O "data/Data_KS.mat"')
|
||||
get_ipython().system('wget "https://github.com/mathLab/PINA/blob/master/tutorials/tutorial10/dat/Data_KS2.mat" -O "data/Data_KS2.mat"')
|
||||
get_ipython().system('wget "https://github.com/mathLab/PINA/raw/refs/heads/master/tutorials/tutorial10/data/Data_KS.mat" -O "data/Data_KS.mat"')
|
||||
get_ipython().system('wget "https://github.com/mathLab/PINA/raw/refs/heads/master/tutorials/tutorial10/data/Data_KS2.mat" -O "data/Data_KS2.mat"')
|
||||
|
||||
import torch
|
||||
import matplotlib.pyplot as plt
|
||||
|
||||
2
tutorials/tutorial5/tutorial.ipynb
vendored
2
tutorials/tutorial5/tutorial.ipynb
vendored
@@ -36,7 +36,7 @@
|
||||
" !pip install \"pina-mathlab\"\n",
|
||||
" !pip install scipy\n",
|
||||
" # get the data\n",
|
||||
" !wget https://github.com/mathLab/PINA/blob/master/tutorials/tutorial5/Data_Darcy.mat\n",
|
||||
" !wget https://github.com/mathLab/PINA/raw/refs/heads/master/tutorials/tutorial5/Data_Darcy.mat\n",
|
||||
"\n",
|
||||
" \n",
|
||||
"# !pip install scipy # install scipy\n",
|
||||
|
||||
2
tutorials/tutorial5/tutorial.py
vendored
2
tutorials/tutorial5/tutorial.py
vendored
@@ -22,7 +22,7 @@ if IN_COLAB:
|
||||
get_ipython().system('pip install "pina-mathlab"')
|
||||
get_ipython().system('pip install scipy')
|
||||
# get the data
|
||||
get_ipython().system('wget https://github.com/mathLab/PINA/blob/master/tutorials/tutorial5/Data_Darcy.mat')
|
||||
get_ipython().system('wget https://github.com/mathLab/PINA/raw/refs/heads/master/tutorials/tutorial5/Data_Darcy.mat')
|
||||
|
||||
|
||||
# !pip install scipy # install scipy
|
||||
|
||||
4
tutorials/tutorial7/tutorial.ipynb
vendored
4
tutorials/tutorial7/tutorial.ipynb
vendored
@@ -65,8 +65,8 @@
|
||||
" !pip install \"pina-mathlab\"\n",
|
||||
" # get the data\n",
|
||||
" !mkdir \"data\"\n",
|
||||
" !wget \"https://github.com/mathLab/PINA/blob/master/tutorials/tutorial7/data/pinn_solution_0.5_0.5\" -O \"data/pinn_solution_0.5_0.5\"\n",
|
||||
" !wget \"https://github.com/mathLab/PINA/blob/master/tutorials/tutorial7/data/pts_0.5_0.5\" -O \"data/pts_0.5_0.5\"\n",
|
||||
" !wget \"https://github.com/mathLab/PINA/raw/refs/heads/master/tutorials/tutorial7/data/pinn_solution_0.5_0.5\" -O \"data/pinn_solution_0.5_0.5\"\n",
|
||||
" !wget \"https://github.com/mathLab/PINA/raw/refs/heads/master/tutorials/tutorial7/data/pts_0.5_0.5\" -O \"data/pts_0.5_0.5\"\n",
|
||||
" \n",
|
||||
"import matplotlib.pyplot as plt\n",
|
||||
"plt.style.use('tableau-colorblind10')\n",
|
||||
|
||||
4
tutorials/tutorial7/tutorial.py
vendored
4
tutorials/tutorial7/tutorial.py
vendored
@@ -38,8 +38,8 @@ if IN_COLAB:
|
||||
get_ipython().system('pip install "pina-mathlab"')
|
||||
# get the data
|
||||
get_ipython().system('mkdir "data"')
|
||||
get_ipython().system('wget "https://github.com/mathLab/PINA/blob/master/tutorials/tutorial7/data/pinn_solution_0.5_0.5" -O "data/pinn_solution_0.5_0.5"')
|
||||
get_ipython().system('wget "https://github.com/mathLab/PINA/blob/master/tutorials/tutorial7/data/pts_0.5_0.5" -O "data/pts_0.5_0.5"')
|
||||
get_ipython().system('wget "https://github.com/mathLab/PINA/raw/refs/heads/master/tutorials/tutorial7/data/pinn_solution_0.5_0.5" -O "data/pinn_solution_0.5_0.5"')
|
||||
get_ipython().system('wget "https://github.com/mathLab/PINA/raw/refs/heads/master/tutorials/tutorial7/data/pts_0.5_0.5" -O "data/pts_0.5_0.5"')
|
||||
|
||||
import matplotlib.pyplot as plt
|
||||
plt.style.use('tableau-colorblind10')
|
||||
|
||||
Reference in New Issue
Block a user