1
00:00:11,690 --> 00:00:12,080
All right.

2
00:00:12,080 --> 00:00:17,720
So if you saw the past few lectures and you had no idea what was going on, you might be a bit alarmed.

3
00:00:17,750 --> 00:00:22,640
You might be wondering, what the heck is numpy and pandas and where can I learn about them?

4
00:00:22,940 --> 00:00:24,860
Luckily, I've got you covered.

5
00:00:24,980 --> 00:00:31,400
It just so happens that I teach all of this for free in my course called the numpy stack in Python.

6
00:00:31,850 --> 00:00:35,240
As usual, you can find this course by searching for its name.

7
00:00:35,240 --> 00:00:38,930
Or you can click my profile and go to my list of courses.

8
00:00:38,930 --> 00:00:45,620
If you still can't find it, you can go to my website Lazy Programmers Me where I list out all my courses

9
00:00:45,620 --> 00:00:46,730
and link to them there.

10
00:00:51,580 --> 00:00:57,070
Now, because this course is free, I'm going to assume that you've taken the time to do your best to

11
00:00:57,070 --> 00:00:58,550
prepare for this course.

12
00:00:58,570 --> 00:01:05,500
That means knowing the basics of numpy, map, plot, lib pandas, psi, pi and psychic learn.

13
00:01:05,710 --> 00:01:09,330
Of course, when I say basics, that might be a little ambiguous.

14
00:01:09,340 --> 00:01:12,540
What is basic to me may not be basic to you.

15
00:01:12,550 --> 00:01:18,520
So let's enumerate and review what you should have learned so that you can make sure you are well equipped

16
00:01:18,520 --> 00:01:20,080
to handle this course.

17
00:01:24,970 --> 00:01:25,750
For numpy.

18
00:01:25,780 --> 00:01:29,860
I essentially want you to know matrix arithmetic in deep learning.

19
00:01:29,860 --> 00:01:35,830
We work with TensorFlow, which might sound scary, but we actually just mean array like a regular old

20
00:01:35,830 --> 00:01:36,970
programming array.

21
00:01:37,180 --> 00:01:42,730
And if you've been paying attention, the name TensorFlow actually includes the word tensor in it,

22
00:01:42,730 --> 00:01:44,770
so you know that it's going to come in handy.

23
00:01:46,170 --> 00:01:50,960
Sensors or if you prefer arrays, can have any number of dimensions.

24
00:01:50,970 --> 00:01:56,490
We have special names for one dimensional sensors and two dimensional sensors, which we call vectors

25
00:01:56,490 --> 00:01:58,290
and matrices, respectively.

26
00:01:58,380 --> 00:02:03,030
But you should not be afraid if you see a3d tensor or a 40 tensor.

27
00:02:05,350 --> 00:02:07,750
Okay, so what do we mean by arithmetic?

28
00:02:08,020 --> 00:02:14,050
That means your basic arithmetic, operations, addition, subtraction, multiplication and division.

29
00:02:14,260 --> 00:02:19,360
Division doesn't really apply when we're talking about matrices, but there is an analogous concept

30
00:02:19,360 --> 00:02:22,900
of matrix inversion, which you should be familiar with.

31
00:02:23,110 --> 00:02:27,250
You should know when addition, subtraction and multiplication are allowed.

32
00:02:28,140 --> 00:02:32,040
For example, you should know that you can add matrices of different sizes.

33
00:02:33,620 --> 00:02:35,750
Multiplication is the key operation.

34
00:02:35,750 --> 00:02:41,640
However, you should know that matrix multiplication is really just the dot product in disguise.

35
00:02:41,660 --> 00:02:48,050
In fact, whether you're doing a dot product between vectors or matrix multiplication between matrices,

36
00:02:48,050 --> 00:02:49,910
these are the same function in numpy.

37
00:02:49,940 --> 00:02:51,230
It's just called dot.

38
00:02:52,960 --> 00:02:57,760
Element wise multiplication is also an important operation in deep learning, so you should know how

39
00:02:57,760 --> 00:02:58,870
to do that as well.

40
00:03:03,690 --> 00:03:08,220
In terms of map plot lib, there isn't really anything fancy you need to know how to do.

41
00:03:08,250 --> 00:03:13,890
Just know about line charts and scatter plots since these are what we'll be using 99% of the time.

42
00:03:18,800 --> 00:03:21,610
In terms of pandas, also pretty simple.

43
00:03:21,620 --> 00:03:24,710
We basically use pandas to load in tabular data.

44
00:03:24,980 --> 00:03:30,140
Pandas does some other useful things, but we won't be making full use of its capabilities.

45
00:03:30,260 --> 00:03:33,590
Most of the time it'll just be to load in a CSV file.

46
00:03:38,380 --> 00:03:39,970
Next, we have sci fi.

47
00:03:40,120 --> 00:03:43,190
Now, I don't anticipate really using sci fi at all.

48
00:03:43,210 --> 00:03:44,950
However, that could change.

49
00:03:45,040 --> 00:03:51,640
Sci fi is kind of like a power version of NumPy, so it has more useful statistics, functions more

50
00:03:51,640 --> 00:03:56,560
useful optimization, functions, more useful linear algebra functions, and so forth.

51
00:03:56,710 --> 00:04:01,270
NumPy is more for those lower level operations, like adding and multiplying.

52
00:04:06,110 --> 00:04:07,970
Finally, we have psychic learn.

53
00:04:08,180 --> 00:04:13,100
Now the point of knowing about psychic learn isn't to know about psychic learning per se.

54
00:04:13,670 --> 00:04:17,150
It's to know about the concepts behind using psychic learn.

55
00:04:17,390 --> 00:04:22,310
In other words, you're going to have to learn about the basics of machine learning in order to make

56
00:04:22,310 --> 00:04:24,170
proper use of psychic learning.

57
00:04:24,620 --> 00:04:30,560
Again, I reiterate I teach this for free, so I don't anticipate any problems catching up.

58
00:04:31,100 --> 00:04:33,050
So here are the things you want to remember.

59
00:04:33,050 --> 00:04:34,160
And keep in mind.

60
00:04:34,580 --> 00:04:38,060
First are the basics of classification and regression.

61
00:04:38,270 --> 00:04:44,210
You want to recall how to think of these as geometry problems rather than magic machine learning voodoo.

62
00:04:44,570 --> 00:04:47,720
Second, you want to be familiar with the shape of data.

63
00:04:49,360 --> 00:04:55,300
Typically for a structured data problem, meaning it not working with images, sound or text, but more

64
00:04:55,300 --> 00:04:57,100
traditional business type data.

65
00:04:57,100 --> 00:05:00,490
We're going to have two objects which we call X and Y.

66
00:05:00,670 --> 00:05:05,380
X represents our input samples and Y represents the corresponding targets.

67
00:05:10,220 --> 00:05:11,810
To give you a simple example.

68
00:05:11,810 --> 00:05:18,080
Suppose we want to predict whether or not a student will pass a math exam in order to build a model.

69
00:05:18,080 --> 00:05:23,090
We've collected a bunch of data points for students who took this math exam in the past.

70
00:05:23,330 --> 00:05:29,210
We record several variables, such as how many hours they spent studying and how many hours they spent

71
00:05:29,210 --> 00:05:30,620
playing video games.

72
00:05:30,710 --> 00:05:33,290
We would treat these as our X matrix.

73
00:05:33,530 --> 00:05:39,260
Our Y matrix would be the target or label, which is what we want to predict in the future for future

74
00:05:39,260 --> 00:05:40,190
students.

75
00:05:40,430 --> 00:05:44,660
So in the future we could ask a student, Hey, how many hours did you study?

76
00:05:44,660 --> 00:05:46,850
How many hours did you play video games?

77
00:05:46,850 --> 00:05:52,550
And then from that information alone, we could make a prediction about whether or not they will pass

78
00:05:52,550 --> 00:05:53,510
the math exam.

79
00:05:55,210 --> 00:06:00,280
Why would be whether or not the student pastor failed and coded as zero or one.

80
00:06:00,910 --> 00:06:07,630
In general, we say that the x matrix is of size nn by dx, where nn is the number of samples and d

81
00:06:07,630 --> 00:06:09,130
is the number of features.

82
00:06:09,340 --> 00:06:14,410
Why is just a one dimensional array of length n which you can also think of as a vector?

83
00:06:19,160 --> 00:06:24,110
You also want to know the steps we take in general when we are writing a machine learning script to

84
00:06:24,110 --> 00:06:26,120
test that a model we've just learned about.

85
00:06:26,390 --> 00:06:28,760
This is going to be pretty much the same every time.

86
00:06:28,760 --> 00:06:32,960
So if you don't know this, you're going to be extremely confused.

87
00:06:33,200 --> 00:06:35,000
The steps are as follows.

88
00:06:35,270 --> 00:06:37,510
Number one, we load in the data.

89
00:06:37,520 --> 00:06:40,010
That's just the X and Y we just talked about.

90
00:06:40,190 --> 00:06:45,740
We will use pandas for this when we have simple data sets, or if we have something more complicated,

91
00:06:45,740 --> 00:06:47,720
we'll write our own python code.

92
00:06:49,100 --> 00:06:55,370
Number two, we can optionally split the data into train and test sets depending on what we are doing.

93
00:06:55,820 --> 00:07:02,240
Note that sometimes the term test set is used interchangeably with validation set, in which case the

94
00:07:02,240 --> 00:07:04,790
true test set would mean something else.

95
00:07:04,940 --> 00:07:06,450
Don't get too fussy over this.

96
00:07:06,470 --> 00:07:07,610
It is what it is.

97
00:07:09,010 --> 00:07:11,230
Number three, we build a model.

98
00:07:11,350 --> 00:07:17,140
Now, in Python, we usually use object oriented programming, which means our model takes the form

99
00:07:17,140 --> 00:07:18,820
of a Python object.

100
00:07:19,300 --> 00:07:22,390
In PyTorch, we still use object oriented programming.

101
00:07:22,390 --> 00:07:26,950
In fact, probably more so than what you're used to if you've only used scikit learn.

102
00:07:27,130 --> 00:07:31,900
Specifically, PyTorch uses subclasses in order to build models.

103
00:07:32,020 --> 00:07:36,700
These models do not work like what you are used to in psych learn, but it's similar.

104
00:07:37,000 --> 00:07:40,120
Ultimately, you should still recognize the following steps.

105
00:07:42,400 --> 00:07:45,970
Number four, we fit the model in psych learn.

106
00:07:46,000 --> 00:07:51,970
This just means calling the fit function on the model and passing in your training data in a deep learning.

107
00:07:51,970 --> 00:07:55,780
This is a little more complicated because we have many more options.

108
00:07:55,930 --> 00:08:01,390
Since training in deep learning involves an iterative training algorithm known as gradient descent,

109
00:08:01,420 --> 00:08:07,270
we typically plot a loss per iteration when we are finished training to confirm that our training process

110
00:08:07,270 --> 00:08:09,130
has converged as expected.

111
00:08:09,490 --> 00:08:12,730
If it didn't, we have to go back and make changes.

112
00:08:13,210 --> 00:08:16,660
And finally, number five, we evaluate the model.

113
00:08:16,780 --> 00:08:21,910
This involves checking the accuracy of our model on both the train and validation sets.

114
00:08:22,450 --> 00:08:26,950
At this time, we can also check to see if the model is overfitting or under fitting.

115
00:08:28,520 --> 00:08:31,970
And once this is all done, we can make predictions with our model.

116
00:08:32,830 --> 00:08:33,700
In PyTorch.

117
00:08:33,700 --> 00:08:35,650
This is a little more complicated than inside.

118
00:08:35,650 --> 00:08:39,490
You learn because PyTorch doesn't really work with numpy arrays.

119
00:08:39,610 --> 00:08:42,670
Instead, PyTorch works with torch sensors.

120
00:08:42,670 --> 00:08:47,940
So there will be a lot of times where we have to convert back and forth between numpy array and torch

121
00:08:47,950 --> 00:08:50,920
tensor depending on what we need at the time.

122
00:08:51,040 --> 00:08:55,270
This might seem strange at first, but you'll get used to it as you get more practice.

123
00:08:56,630 --> 00:09:01,340
This process encapsulates the typical life cycle of a machine learning model.

124
00:09:01,370 --> 00:09:07,460
You load in your data, train a model, evaluate it, and then use it to make future predictions.

125
00:09:11,600 --> 00:09:11,920
Okay.

126
00:09:11,960 --> 00:09:14,210
So just a quick update to this lecture.

127
00:09:14,360 --> 00:09:20,870
I won't name any names, but on certain platforms, meaning certain platforms I personally don't own.

128
00:09:20,900 --> 00:09:26,300
They've made it very hard for students such as yourselves to find free courses.

129
00:09:26,510 --> 00:09:28,550
This doesn't mean that they don't exist.

130
00:09:28,550 --> 00:09:34,370
It simply means that the people behind these platforms have made them very hard for you to find.

131
00:09:34,520 --> 00:09:38,030
Obviously, this is in their best interests, but not yours.

132
00:09:38,060 --> 00:09:41,270
That being said, there is an easy way around this.

133
00:09:41,270 --> 00:09:47,390
Specifically, it is better to simply go to my website, which is deep learning courses dot com, where

134
00:09:47,390 --> 00:09:50,270
it should be very easy to find my free course.

135
00:09:54,580 --> 00:09:59,740
Now you might be wondering what's the difference between this website and other websites where you can

136
00:09:59,740 --> 00:10:00,970
find my courses?

137
00:10:01,240 --> 00:10:07,060
The answer is that the courses on my website are always a superset of courses which have the same name

138
00:10:07,060 --> 00:10:08,320
on other sites.

139
00:10:08,530 --> 00:10:13,870
In other words, if you use deep learning courses dot com, you are getting the best value for each

140
00:10:13,870 --> 00:10:15,250
dollar you spend.

141
00:10:19,600 --> 00:10:24,700
Now, just as a quick side note, what if you do really want to get the course on this website?

142
00:10:24,730 --> 00:10:26,320
Well, you still can.

143
00:10:26,470 --> 00:10:32,140
As mentioned, you simply need to go to my profile, which has a list of all the courses I teach and

144
00:10:32,140 --> 00:10:34,660
scroll through them to find the relevant course.

145
00:10:34,960 --> 00:10:39,460
I'm not sure that they show up in any particular order, so you just have to scroll through them all.

146
00:10:44,090 --> 00:10:48,170
Finally, just a brief note on why there are two versions of this course.

147
00:10:48,200 --> 00:10:51,020
You see, there's a free version and the paid version.

148
00:10:51,440 --> 00:10:56,960
The reason there's two is because, again, this platform, which by the way, I don't work for, made

149
00:10:56,960 --> 00:11:00,320
some changes a few years ago to how free courses work.

150
00:11:00,410 --> 00:11:04,460
Therefore, it was by necessity that two versions were created.

151
00:11:04,880 --> 00:11:08,950
Remember that instructors such as myself are not employees of this company.

152
00:11:08,960 --> 00:11:14,630
We are simply users of this website, just like how you are a user of Gmail, Hotmail and what have

153
00:11:14,630 --> 00:11:15,020
you.

154
00:11:15,680 --> 00:11:17,300
So I'm a user of this website.

155
00:11:17,300 --> 00:11:19,670
I don't have any control over how it works.
