1
00:00:01,000 --> 00:00:05,620
Pins or physics informed neural networks are.

2
00:00:06,930 --> 00:00:14,940
A neural network that is a deep neural network that combines both the power of neural networks with

3
00:00:14,940 --> 00:00:17,610
the physics laws.

4
00:00:17,910 --> 00:00:25,770
Of course, the purpose of doing pins is to solve a mainly partial differential equations.

5
00:00:25,800 --> 00:00:28,680
However, the idea is is mainly about.

6
00:00:29,420 --> 00:00:37,700
Using physics and its laws along with neural networks, to achieve modeling, modeling of a system.

7
00:00:37,790 --> 00:00:43,130
And by that we can actually calculate a whole system in a very quick way.

8
00:00:43,710 --> 00:00:51,360
It's all about how we train the neural network and for how many boundary condition, for how many initial

9
00:00:51,360 --> 00:00:55,080
conditions to actually make it successful to achieve that.

10
00:00:56,130 --> 00:01:05,340
So basically this is a pens and as I said, it is a combination physics with neural networks.

11
00:01:06,460 --> 00:01:08,440
Now how it works.

12
00:01:08,440 --> 00:01:22,360
So basically the pins will work using or training on a data and this data or in order to model an actual

13
00:01:22,360 --> 00:01:26,320
system, we need to do well, mainly two things.

14
00:01:26,320 --> 00:01:33,760
The first thing is we need to to have this network and have this loss to be calculated.

15
00:01:33,790 --> 00:01:39,250
Now, it's not enough to actually calculating the the the loss.

16
00:01:39,250 --> 00:01:44,740
That is, we model the system as X, for example, if it's one dimensional system, we have X and T

17
00:01:44,920 --> 00:01:46,300
and we will get you.

18
00:01:46,330 --> 00:01:53,170
It's not enough to have an input of X, an input of T, and we only get you for let's say, the boundary

19
00:01:53,170 --> 00:01:54,430
condition and so on.

20
00:01:55,150 --> 00:01:56,620
And of course the initial condition.

21
00:01:56,620 --> 00:02:03,520
The problem is what we will face is there are many points in the domain like in between that needs to

22
00:02:03,520 --> 00:02:04,120
converge.

23
00:02:04,120 --> 00:02:10,550
And this is why we need well, basically the the partial differential equation.

24
00:02:10,730 --> 00:02:15,590
And these points have to follow these pdes laws.

25
00:02:15,590 --> 00:02:23,540
And well, basically, now we have the we have to we have the loss that has to be minimized.

26
00:02:24,020 --> 00:02:26,060
And the loss comes from two sources.

27
00:02:26,060 --> 00:02:35,330
That is the PDE and of course the partial well, the the the boundary condition and the initial condition.

28
00:02:35,330 --> 00:02:40,190
So basically this is what how how mainly it works.

29
00:02:40,190 --> 00:02:42,980
And so we need a system.

30
00:02:42,980 --> 00:02:48,650
We need a partial differential equation that is capable to solve our problem.

31
00:02:48,650 --> 00:02:51,770
Capable is not it depends on how complex the problem.

32
00:02:51,770 --> 00:02:53,630
We will build these networks.

33
00:02:53,630 --> 00:02:56,030
And it's for for simple equations.

34
00:02:56,030 --> 00:02:58,040
We don't have to be very deep.

35
00:02:58,040 --> 00:03:04,040
And of course we we don't have to have many input conditions and of course, output conditions.

36
00:03:04,580 --> 00:03:10,510
The second thing, of course, we need a that describes the physical systems and then we just calculate

37
00:03:10,510 --> 00:03:11,170
the loss.

38
00:03:11,170 --> 00:03:21,400
So, so this is the idea behind pens is just need to have the PDE to calculate the losses.

39
00:03:22,690 --> 00:03:29,590
Now how the domain works or okay, you want to calculate the loss, but for what?

40
00:03:29,860 --> 00:03:32,200
Where did you where do you get the data?

41
00:03:32,590 --> 00:03:37,090
The data is actually is the boundary condition and the initial condition.

42
00:03:37,090 --> 00:03:39,250
So this is you have two parts of data.

43
00:03:39,280 --> 00:03:41,960
The first one is boundary condition and initial condition.

44
00:03:41,980 --> 00:03:48,400
This is these conditions are part of the data and it's very important part of the data.

45
00:03:48,520 --> 00:03:51,440
The second part of the data is the domain parts.

46
00:03:51,460 --> 00:03:59,110
And these domain points which are in the middle all over here randomly, you know, you can put them

47
00:03:59,110 --> 00:04:02,830
over there just randomly with the with the sufficient density.

48
00:04:02,830 --> 00:04:05,080
Of course, it has to be sufficient.

49
00:04:05,750 --> 00:04:07,130
And the sufficient means.

50
00:04:07,130 --> 00:04:11,300
It depends on the actual equation and the problem we're trying to solve.

51
00:04:11,300 --> 00:04:20,990
And we have to basically calculate the loss in order to satisfy the boundary conditions and satisfy

52
00:04:21,020 --> 00:04:23,420
the physics of the initial conditions.

53
00:04:23,420 --> 00:04:33,410
So the the network, if you put a a point in the boundary, the network has to understand this is this

54
00:04:33,440 --> 00:04:41,120
is a boundary point and it has a specific value in order to achieve so well, we need to.

55
00:04:41,120 --> 00:04:47,660
That means we have to create many boundary points and to feed these boundary points to the network in

56
00:04:47,660 --> 00:04:54,860
order to make sure that whenever the network sees this as a boundary point, it will give it the correct

57
00:04:54,860 --> 00:04:55,610
answer.

58
00:04:56,300 --> 00:04:57,980
The domain point is the same.

59
00:04:57,980 --> 00:05:05,210
We put a domain point, and this domain point has, along with everything around it, has to satisfy

60
00:05:05,310 --> 00:05:06,150
the physics law.

61
00:05:06,180 --> 00:05:12,840
We keep doing this until basically the network is converged and the loss is minimized.

62
00:05:13,140 --> 00:05:16,500
Getting, well, a converged solution, get a solution.

63
00:05:16,500 --> 00:05:22,590
And then once we have that, we have the network, we give it X, we give it T or x, Y, whatever the

64
00:05:22,590 --> 00:05:26,940
network, whatever the situation is, and it will give us the answer.

65
00:05:28,180 --> 00:05:30,370
So how to solve it?

66
00:05:30,400 --> 00:05:33,250
We have basically a general steps.

67
00:05:33,490 --> 00:05:42,130
The first step is you define the network or this is how to solve it while using torch or using, you

68
00:05:42,130 --> 00:05:49,720
know, like a library that is will handle the deep neural network.

69
00:05:49,720 --> 00:06:00,850
However, of course we will also solve it using some easy or well written libraries for only solving

70
00:06:00,850 --> 00:06:01,270
pens.

71
00:06:01,270 --> 00:06:08,950
However, these are the steps that we need to achieve in order to solve the network using, um, well,

72
00:06:08,950 --> 00:06:10,090
mainly torch.

73
00:06:10,140 --> 00:06:12,940
The first thing is we need to define the network.

74
00:06:12,940 --> 00:06:16,990
We need to define what are the inputs and what are the outputs.

75
00:06:16,990 --> 00:06:25,720
For example, if it's a 2D problem, we will have X and Y and we will get a value or multiple value.

76
00:06:25,720 --> 00:06:33,370
For example, the velocity in the direction, the velocity in the V direction and let's say the rho,

77
00:06:33,400 --> 00:06:35,950
the the density.

78
00:06:37,490 --> 00:06:44,690
After that, we have to define the initial condition and the boundary conditions and a well followed

79
00:06:44,690 --> 00:06:45,320
by this.

80
00:06:45,350 --> 00:06:48,830
We have to set our optimizers, usually in pins.

81
00:06:48,860 --> 00:06:56,750
We start with a kind of general optimizer like Adam, and then we go for a optimizers that will take

82
00:06:56,750 --> 00:07:01,940
into consideration or will tweak the loss to be as small as possible.

83
00:07:02,530 --> 00:07:06,760
And then what we will do is we need to define the loss function.

84
00:07:06,760 --> 00:07:17,000
We're trying to define the loss functions to basically satisfy the both the boundary, the the the the

85
00:07:17,000 --> 00:07:25,120
the boundary conditions and the initial condition as well as the residual errors or the pdes that needs

86
00:07:25,120 --> 00:07:26,320
to be calculated.

87
00:07:27,540 --> 00:07:34,020
And after that we just run the training loop we need, same as any network.

88
00:07:34,020 --> 00:07:44,190
It has epochs, it has to be trained and, you know, like go round and round until the loss is minimized.

89
00:07:44,400 --> 00:07:50,250
And then once we have the result, we have the post-processing, we get these results and we plot them

90
00:07:50,250 --> 00:07:54,150
as any CFD or finite difference methods.

91
00:07:54,540 --> 00:07:58,920
So these are the general steps of solving pens.

92
00:07:58,920 --> 00:08:06,570
And hopefully in this course we will as much as possible be detailed in the explanation.

93
00:08:06,570 --> 00:08:13,740
Of course, pens and numerical solutions is not, well let's say, established.

94
00:08:13,770 --> 00:08:15,480
It's not well developed.

95
00:08:15,480 --> 00:08:25,110
But I think in the next in the in the future, we will have more and more well researchers and engineers

96
00:08:25,110 --> 00:08:29,530
that they are going to use it in order to get a fast solutions.
