check on Colab option

This commit is contained in:
AleDinve
2024-10-31 15:26:00 +01:00
committed by Nicola Demo
parent a5e326c927
commit db521ef468
11 changed files with 18 additions and 14 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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",

View File

@@ -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

View File

@@ -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",

View File

@@ -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

View File

@@ -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",

View File

@@ -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')