Update Condition notation, delete error outputs and output folders

This commit is contained in:
MatteB03
2025-03-07 14:23:55 +01:00
committed by Nicola Demo
parent 0297344914
commit 2aac9d1ba7
13 changed files with 84 additions and 121762 deletions

File diff suppressed because one or more lines are too long

Binary file not shown.

Binary file not shown.

View File

@@ -260,7 +260,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": null,
"metadata": {},
"outputs": [
{
@@ -300,8 +300,8 @@
"class NeuralOperatorProblem(AbstractProblem):\n",
" input_variables = initial_cond_train.labels\n",
" output_variables = sol_train.labels\n",
" conditions = {'data' : Condition(input_points=initial_cond_train, \n",
" output_points=sol_train)}\n",
" conditions = {'data' : Condition(input=initial_cond_train, \n",
" target=sol_train)}\n",
"\n",
"\n",
"# initialize problem\n",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 204 KiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -150,7 +150,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": null,
"id": "8b27d283",
"metadata": {
"ExecuteTime": {
@@ -163,8 +163,8 @@
"class NeuralOperatorSolver(AbstractProblem):\n",
" input_variables = k_train.full_labels[3]['dof']\n",
" output_variables = u_train.full_labels[3]['dof']\n",
" conditions = {'data' : Condition(input_points=k_train, \n",
" output_points=u_train)}\n",
" conditions = {'data' : Condition(input=k_train, \n",
" target=u_train)}\n",
"# make problem\n",
"problem = NeuralOperatorSolver()"
]

Binary file not shown.

Binary file not shown.

View File

@@ -85,12 +85,12 @@
"id": "5138afdf-bff6-46bf-b423-a22673190687",
"metadata": {},
"source": [
"Then, we import the pre-saved data, for ($\\mu_1$, $\\mu_2$)=($0.5$, $0.5$). These two values are the optimal parameters that we want to find through the neural network training. In particular, we import the `input_points`(the spatial coordinates), and the `output_points` (the corresponding $u$ values evaluated at the `input_points`)."
"Then, we import the pre-saved data, for ($\\mu_1$, $\\mu_2$)=($0.5$, $0.5$). These two values are the optimal parameters that we want to find through the neural network training. In particular, we import the `input` points (the spatial coordinates), and the `target` points (the corresponding $u$ values evaluated at the `input`)."
]
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": null,
"id": "2c55d972-09a9-41de-9400-ba051c28cdcb",
"metadata": {},
"outputs": [
@@ -104,8 +104,8 @@
}
],
"source": [
"data_output = torch.load('data/pinn_solution_0.5_0.5').detach()\n",
"data_input = torch.load('data/pts_0.5_0.5')"
"data_output = torch.load('data/pinn_solution_0.5_0.5', weights_only = False).detach()\n",
"data_input = torch.load('data/pts_0.5_0.5', weights_only = False)"
]
},
{
@@ -168,7 +168,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": null,
"id": "8ec0d95d-72c2-40a4-a310-21c3d6fe17d2",
"metadata": {},
"outputs": [],
@@ -216,7 +216,7 @@
" 'phys_cond': Condition(domain=CartesianDomain({'x': [x_min, x_max], 'y': [y_min, y_max]\n",
" }),\n",
" equation=Equation(laplace_equation)),\n",
" 'data': Condition(input_points=data_input.extract(['x', 'y']), output_points=data_output)\n",
" 'data': Condition(input=data_input.extract(['x', 'y']), target=data_output)\n",
" }\n",
"\n",
"problem = Poisson()"

View File

@@ -176,12 +176,12 @@
"id": "c46410fa-2718-4fc9-977a-583fe2390028",
"metadata": {},
"source": [
"It is now time to define the problem! We inherit from `ParametricProblem` (since the space invariant typically of this methodology), just defining a simple *input-output* condition."
"It is now time to define the problem! We inherit from `ParametricProblem` (since the space invariance typical of this methodology), just defining a simple *input-target* condition."
]
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": null,
"id": "55cef553-7495-401d-9d17-1acff8ec5953",
"metadata": {},
"outputs": [],
@@ -191,7 +191,7 @@
" parameter_domain = CartesianDomain({'mu': [0, 100]})\n",
"\n",
" conditions = {\n",
" 'io': Condition(input_points=p_train, output_points=u_train)\n",
" 'io': Condition(input=p_train, target=u_train)\n",
" }\n",
"\n",
"poisson_problem = SnapshotProblem()"

File diff suppressed because one or more lines are too long