Skip to content

Commit

Permalink
domains basic tutorial completed
Browse files Browse the repository at this point in the history
  • Loading branch information
praksharma committed Jul 16, 2023
1 parent ce24652 commit 76eea11
Showing 1 changed file with 49 additions and 37 deletions.
86 changes: 49 additions & 37 deletions Tutorials/4. Dataset/1. basic.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 2,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -31,7 +31,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -42,7 +42,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -51,7 +51,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -72,14 +72,14 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 6,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/hell/Desktop/DeepINN/Tutorials/4. dataset/../../DeepINN/geometry/samplers/grid_samplers.py:78: UserWarning: First iteration did not find any valid grid points, for\n",
"/home/hell/Desktop/DeepINN/Tutorials/4. Dataset/../../DeepINN/geometry/samplers/grid_samplers.py:78: UserWarning: First iteration did not find any valid grid points, for\n",
" the given filter.\n",
" Will try again with n = 10 * self.n_points. Or\n",
" else use only random points!\n",
Expand All @@ -92,7 +92,7 @@
"(torch.Size([20, 1]), torch.Size([1, 1]), torch.Size([1, 1]))"
]
},
"execution_count": 5,
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -104,7 +104,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 7,
"metadata": {},
"outputs": [
{
Expand All @@ -113,7 +113,7 @@
"torch.Size([20, 1])"
]
},
"execution_count": 6,
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -125,7 +125,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 8,
"metadata": {},
"outputs": [
{
Expand All @@ -134,7 +134,7 @@
"torch.Size([1, 1])"
]
},
"execution_count": 7,
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -146,7 +146,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 9,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -165,7 +165,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 10,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -190,7 +190,7 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 11,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -201,7 +201,7 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 12,
"metadata": {},
"outputs": [
{
Expand All @@ -210,7 +210,7 @@
"torch.Size([20, 1])"
]
},
"execution_count": 11,
"execution_count": 12,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -223,7 +223,7 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": 13,
"metadata": {},
"outputs": [
{
Expand All @@ -232,7 +232,7 @@
"(torch.Size([20, 1]), torch.Size([20, 1]))"
]
},
"execution_count": 12,
"execution_count": 13,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -244,7 +244,7 @@
},
{
"cell_type": "code",
"execution_count": 13,
"execution_count": 14,
"metadata": {},
"outputs": [
{
Expand All @@ -253,7 +253,7 @@
"[tensor([[0.]]), tensor([[1.]])]"
]
},
"execution_count": 13,
"execution_count": 14,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -266,7 +266,7 @@
},
{
"cell_type": "code",
"execution_count": 14,
"execution_count": 15,
"metadata": {},
"outputs": [
{
Expand All @@ -275,7 +275,7 @@
"(2, 2)"
]
},
"execution_count": 14,
"execution_count": 15,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -287,7 +287,7 @@
},
{
"cell_type": "code",
"execution_count": 20,
"execution_count": 16,
"metadata": {},
"outputs": [
{
Expand All @@ -296,7 +296,7 @@
"[tensor([[0.]]), tensor([[1.]])]"
]
},
"execution_count": 20,
"execution_count": 16,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -307,7 +307,7 @@
},
{
"cell_type": "code",
"execution_count": 21,
"execution_count": 17,
"metadata": {},
"outputs": [
{
Expand All @@ -316,7 +316,7 @@
"torch.Size([1, 1])"
]
},
"execution_count": 21,
"execution_count": 17,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -327,23 +327,35 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 22,
"metadata": {},
"outputs": [],
"source": [
"boundary_point_sample[0].requires_grad = True\n",
"\n",
"# y is the output neuron of a hypothetical neural network\n",
"# the output and the input should be connected to the graph to enable chain rule.\n",
"y = boundary_point_sample[0] + boundary_point_labels[0]"
]
},
{
"cell_type": "code",
"execution_count": 23,
"metadata": {},
"outputs": [
{
"ename": "TypeError",
"evalue": "laplace() missing 2 required positional arguments: 'X' and 'y'",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mTypeError\u001b[0m Traceback (most recent call last)",
"Cell \u001b[0;32mIn[14], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m laplace()\n",
"\u001b[0;31mTypeError\u001b[0m: laplace() missing 2 required positional arguments: 'X' and 'y'"
]
"data": {
"text/plain": [
"tensor([[1.]])"
]
},
"execution_count": 23,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"laplace()"
"laplace(boundary_point_sample[0],y)"
]
}
],
Expand Down

0 comments on commit 76eea11

Please sign in to comment.