1
00:00:11,030 --> 00:00:16,370
So in this lecture, we are going to discuss how you, as a beginner, should approach the coding lectures

2
00:00:16,370 --> 00:00:17,330
in this course.

3
00:00:18,230 --> 00:00:23,240
The reason I've created this lecture is that I've noticed some beginner students are a bit confused

4
00:00:23,240 --> 00:00:25,970
about the approach we take to the code lectures.

5
00:00:26,480 --> 00:00:31,580
Specifically, they might be wondering why I'm not coding live on the screen or why they can't code

6
00:00:31,580 --> 00:00:32,060
along.

7
00:00:32,750 --> 00:00:37,520
What I hope you'll see by the end of this lecture is that these questions are just misinformed.

8
00:00:37,940 --> 00:00:41,870
Any confusion you may have is based on incorrect assumptions.

9
00:00:42,800 --> 00:00:49,100
Specifically, this lecture is going to answer a few questions, namely no one should you code along.

10
00:00:49,400 --> 00:00:50,390
The answer is no.

11
00:00:51,050 --> 00:00:54,260
Number two, can you call along if you really want to?

12
00:00:54,650 --> 00:00:55,670
The answer is yes.

13
00:00:56,150 --> 00:00:59,540
Number three, how can you practice what you've learned in this course?

14
00:00:59,780 --> 00:01:02,060
And what are the exercises in this course?

15
00:01:02,660 --> 00:01:07,070
So if you had any or perhaps all of these questions, this lecture is for you.

16
00:01:11,920 --> 00:01:17,800
OK, so the first question we're going to tackle is, should you call along, as stated in my recommendation

17
00:01:17,800 --> 00:01:18,400
is no.

18
00:01:19,090 --> 00:01:24,190
This may surprise some of you, especially if you are a beginner or if you've taken other beginner courses

19
00:01:24,190 --> 00:01:24,850
online.

20
00:01:25,480 --> 00:01:29,950
In those courses, coding along is typically encouraged from my experience.

21
00:01:30,430 --> 00:01:32,590
In fact, I'm not immune to this myself.

22
00:01:33,070 --> 00:01:37,930
If you take some of my oldest courses, which came out approximately five years before this course,

23
00:01:38,320 --> 00:01:43,420
I also encourage students to code along because I assume that this was the normal thing to do.

24
00:01:44,140 --> 00:01:48,880
Of course, after five years of teaching, I've realized why this is not a good idea at all.

25
00:01:49,390 --> 00:01:54,760
In fact, this live coding approach is not good for either of us, neither you nor myself.

26
00:01:59,390 --> 00:02:02,300
So let me start with why coding along is bad for you.

27
00:02:03,840 --> 00:02:07,710
Firstly, it gives you an extremely false impression of how this code is written.

28
00:02:08,520 --> 00:02:13,920
This is not how code is written in the real world, especially complex code like the code in this course.

29
00:02:14,490 --> 00:02:19,350
Doing things by going along with the instructor makes sense in other areas like playing guitar or doing

30
00:02:19,350 --> 00:02:21,870
yoga, but it makes no sense in coding.

31
00:02:22,530 --> 00:02:25,230
Unlike guitar and yoga, coding is a mental thing.

32
00:02:25,380 --> 00:02:27,630
It's about what goes on inside your mind.

33
00:02:28,140 --> 00:02:30,150
Guitar and yoga are physical things.

34
00:02:30,150 --> 00:02:32,070
They are about what you can do with your body.

35
00:02:33,030 --> 00:02:38,840
A coding lecture where the instructor types everything from start to end might take maybe 10 or 20 minutes,

36
00:02:39,270 --> 00:02:42,630
but this is only because the code was prepared beforehand.

37
00:02:43,110 --> 00:02:48,840
In reality, this code required thinking in order to design the structure research in order to learn

38
00:02:48,840 --> 00:02:53,490
the syntax for any APIs that were used and debugging to fix mistakes.

39
00:02:55,010 --> 00:02:59,930
This does not teach you how to write the code from scratch because this code was not written from scratch

40
00:03:00,140 --> 00:03:01,700
as you were seeing it typed lot.

41
00:03:02,540 --> 00:03:07,550
And by the way, if anyone tells you they write code without making mistakes, they are not only lying

42
00:03:07,550 --> 00:03:11,840
but also too inexperienced to even know that what they are saying is impossible.

43
00:03:12,530 --> 00:03:17,300
In effect, all you are really doing is wasting time watching the instructor type in the screen.

44
00:03:22,030 --> 00:03:27,880
What you should be paying more attention to is the thinking process behind the coding, that is to say

45
00:03:27,880 --> 00:03:30,850
coding is more about thinking, not about typing.

46
00:03:31,510 --> 00:03:35,290
Coding complex problems does not happen linearly from start to end.

47
00:03:35,950 --> 00:03:41,860
One example of that is test driven development, also known as TDD, which is a common process used

48
00:03:41,860 --> 00:03:45,550
in modern software engineering companies such as Google and Facebook.

49
00:03:46,570 --> 00:03:52,720
This process is used with the expectation that you will make mistakes, and thus it is much more realistic.

50
00:03:53,680 --> 00:03:57,190
So let's reiterate this coding lie from start to end.

51
00:03:57,220 --> 00:04:00,730
Not realistic, test driven development.

52
00:04:01,120 --> 00:04:05,530
This is a real coding process that is used by professional companies around the world.

53
00:04:06,130 --> 00:04:10,990
So instead of mindlessly watching someone type on the screen and believing that anyone actually codes

54
00:04:10,990 --> 00:04:14,410
anything this way, let's review what you should be doing instead.

55
00:04:15,040 --> 00:04:18,490
Firstly, you should be thinking about the overall structure of the code.

56
00:04:18,820 --> 00:04:23,620
As I describe it to you, and as I describe the reasons why it is structured the way it is.

57
00:04:24,310 --> 00:04:27,190
Secondly, you should be paying attention to the syntax.

58
00:04:27,730 --> 00:04:32,770
And of course, without knowing the syntax, you can write any of this code yourself, which is presumably

59
00:04:32,770 --> 00:04:34,210
what you want to do in the future.

60
00:04:38,810 --> 00:04:43,700
So now let's enter the other side of this question, which is why coding live is bad for me.

61
00:04:44,240 --> 00:04:46,700
We've just established why it's not going to help you.

62
00:04:48,050 --> 00:04:49,280
Well, it's pretty simple.

63
00:04:49,670 --> 00:04:54,110
If I'm trying to type and talk at the same time, then I'm trying to do two things at once.

64
00:04:54,590 --> 00:04:57,980
But if I'm only talking, then I can focus on that one thing.

65
00:04:58,250 --> 00:05:03,260
And therefore, I can go into much greater detail and be much more precise in what I say.

66
00:05:03,830 --> 00:05:08,210
This ends up being good for you because it means you're getting better information transfer.

67
00:05:08,540 --> 00:05:13,250
And what I'm saying will be much smoother than if I tried to come up with it while typing at the same

68
00:05:13,250 --> 00:05:13,790
time.

69
00:05:14,660 --> 00:05:20,420
So not only is typing pointless as we previously established, it's also better to not type because

70
00:05:20,420 --> 00:05:22,730
it helps me communicate better with you.

71
00:05:27,380 --> 00:05:32,540
OK, so now let's move on to question number two, which is, can you quote along if you really want

72
00:05:32,540 --> 00:05:34,550
to disregard my previous advice?

73
00:05:35,060 --> 00:05:36,770
The answer to this question is yes.

74
00:05:37,430 --> 00:05:41,360
Now, before some student comes along and asks, Why do you even have to say this?

75
00:05:41,360 --> 00:05:42,500
Isn't this obvious?

76
00:05:42,950 --> 00:05:47,990
Let me just shut that down right now and tell you for some students, it's not obvious, given that

77
00:05:47,990 --> 00:05:49,940
I've been asked this question a few times.

78
00:05:50,480 --> 00:05:55,790
You see, I think these students may have been confused, perhaps assuming that because I wasn't typing

79
00:05:55,790 --> 00:05:57,440
that they also could not type.

80
00:05:57,950 --> 00:06:01,910
Of course, now that I'm saying this out loud, you should realize this is complete nonsense.

81
00:06:02,300 --> 00:06:04,670
For example, I can show you this piece of code.

82
00:06:05,060 --> 00:06:07,460
You can type this out right now if you like.

83
00:06:07,820 --> 00:06:09,980
I don't have to type it for you to type it.

84
00:06:10,550 --> 00:06:15,200
There is no requirement that I'm actually typing on the keyboard for you to start typing.

85
00:06:15,890 --> 00:06:18,170
Again, this is not like yoga for yoga.

86
00:06:18,200 --> 00:06:20,870
Yes, you want to see your teacher doing the moves.

87
00:06:21,410 --> 00:06:26,390
Now again, I know this is obvious, but some students really have asked me this question, so please

88
00:06:26,390 --> 00:06:27,080
bear with me.

89
00:06:31,670 --> 00:06:35,780
OK, so now let's move on to question number three, which I've also discussed elsewhere, but I'll

90
00:06:35,780 --> 00:06:37,370
answer again here for good measure.

91
00:06:38,060 --> 00:06:43,220
And this is how can you practice what you've learned in this course, given that I've now deprived you

92
00:06:43,220 --> 00:06:45,860
of this interactive exercise of coding a law?

93
00:06:46,670 --> 00:06:50,780
Well, let's remind ourselves that coding along is not actually a good exercise.

94
00:06:51,290 --> 00:06:55,730
Remember, you were not learning anything about the coding process when you do that, because that's

95
00:06:55,730 --> 00:06:57,980
not even how the coding process was done.

96
00:06:58,580 --> 00:07:04,400
If the coding lecture was 10 minutes, the coding process probably took maybe 60 minutes, maybe even

97
00:07:04,400 --> 00:07:05,120
days.

98
00:07:05,630 --> 00:07:10,790
So that should be the time commitment you're looking at when you do an exercise, at least at this level

99
00:07:10,790 --> 00:07:11,720
of machine learning.

100
00:07:12,590 --> 00:07:17,510
Now, to really answer this question, we have to go a bit meta, and that's to discuss the two kinds

101
00:07:17,510 --> 00:07:19,820
of courses that can exist in machine learning.

102
00:07:24,570 --> 00:07:29,370
The first kind, of course, is the theory course, where I teach you, say, the naive Bayes algorithm

103
00:07:29,790 --> 00:07:35,880
and then you go and implement that algorithm in code in that kind, of course, implementing the algorithm

104
00:07:35,880 --> 00:07:39,900
is the exercise, and that's a really powerful skill to have.

105
00:07:40,380 --> 00:07:46,500
That means you can take an idea and make that idea practical by turning it into a working computer program.

106
00:07:47,160 --> 00:07:51,660
And of course, anyone who invents a new machine learning models must have this skill.

107
00:07:53,040 --> 00:07:58,290
By definition, if you invent a new machine learning algorithm, then there is no existing code for

108
00:07:58,290 --> 00:07:58,650
it.

109
00:07:59,040 --> 00:08:02,040
You will be the one who makes the first working example.

110
00:08:02,460 --> 00:08:05,180
And if you can't code, then it will never be made.

111
00:08:06,360 --> 00:08:09,960
So in this case, the concept of exercise is very straightforward.

112
00:08:10,380 --> 00:08:15,750
You're given an idea, an algorithm, and your exercise is to put that into working code.

113
00:08:16,350 --> 00:08:21,750
And obviously, you should do this before looking at my code, which is the solution to the exercise

114
00:08:22,170 --> 00:08:27,510
that is, don't look at the solution to the exercise before doing the exercise yourself.

115
00:08:32,140 --> 00:08:36,340
Now, that doesn't really apply to this course, because this is not a theory course.

116
00:08:36,760 --> 00:08:38,650
This course is an API course.

117
00:08:38,860 --> 00:08:44,140
I'm teaching you how to use an existing library where your goal is mostly to learn about the syntax

118
00:08:44,410 --> 00:08:45,790
rather than the concepts.

119
00:08:46,240 --> 00:08:51,250
Although we do still touch on concepts in this class, we're not going to do something like derive back

120
00:08:51,250 --> 00:08:55,180
propagation because that's irrelevant to the library we're learning about.

121
00:08:55,750 --> 00:09:01,210
So in this type of class, it would be impossible for you to write out any code before I show it to

122
00:09:01,210 --> 00:09:07,270
you, because obviously you simply won't know the syntax in this type of class.

123
00:09:07,540 --> 00:09:10,210
There are two kinds of exercises and projects.

124
00:09:10,840 --> 00:09:13,930
The first kind is the kind I'm going to explicitly give you.

125
00:09:14,410 --> 00:09:17,740
That is, you'll hear me say in the lecture, Please do this exercise.

126
00:09:18,100 --> 00:09:23,440
And after hearing there, it will be your choice, whether or not you want to go ahead and do that exercise

127
00:09:24,070 --> 00:09:24,940
as a side note.

128
00:09:24,970 --> 00:09:30,730
Please note that for this class, the explicit exercise prompts and data sets are included only in the

129
00:09:30,730 --> 00:09:31,720
VIP version.

130
00:09:32,620 --> 00:09:37,960
If you don't know what that means, please contact me using the contact form on my website, which is

131
00:09:37,960 --> 00:09:39,760
that lazy programmer taught me.

132
00:09:44,450 --> 00:09:50,510
Now, the second kind of exercise is implicit, that is, although I'm not going to explicitly tell

133
00:09:50,510 --> 00:09:54,110
you to do something, it should be obvious that you would do it anyway.

134
00:09:55,130 --> 00:09:58,430
My assumption is that we're all responsible, mature adults.

135
00:09:58,850 --> 00:10:02,900
You know why you're in this course and you know why you want to learn about machine learning.

136
00:10:03,350 --> 00:10:07,490
And that's probably because you want to apply it to some data set you have.

137
00:10:08,060 --> 00:10:14,210
For example, if you work in manufacturing, perhaps you're interested in using computer vision to identify

138
00:10:14,210 --> 00:10:15,380
defective parts.

139
00:10:16,280 --> 00:10:21,680
Well, after taking this course, you should be able to apply the code I've shown you to your own data

140
00:10:21,680 --> 00:10:22,250
sets.

141
00:10:23,150 --> 00:10:25,430
Now, here's the really neat thing about machine learning.

142
00:10:26,030 --> 00:10:28,730
This process does not require any new code.

143
00:10:29,240 --> 00:10:32,840
Therefore, you're going to simply be applying the code you've already learned.

144
00:10:33,320 --> 00:10:36,050
This will give you practice in writing that code yourself.

145
00:10:36,740 --> 00:10:40,550
But again, this code is more or less the same as what you've learned in this course.

146
00:10:41,150 --> 00:10:42,800
I encapsulate this with my rule.

147
00:10:42,800 --> 00:10:44,090
All data is the same.

148
00:10:44,810 --> 00:10:48,710
What this means is that the same code will work no matter the data sets.

149
00:10:53,290 --> 00:10:55,210
For example, take a neural network.

150
00:10:55,630 --> 00:10:58,810
We know that neural networks can work for something like fraud detection.

151
00:10:59,560 --> 00:11:04,360
Well, now suppose that I want to use a neural network for a new task like disease prediction.

152
00:11:05,080 --> 00:11:08,260
Surprisingly, this does not require any new code at all.

153
00:11:08,770 --> 00:11:12,010
All that's left to do is to simply plug in your data set.

154
00:11:12,490 --> 00:11:17,680
And this is why we can have libraries like Circuit Learn, which is used by researchers in many fields

155
00:11:17,770 --> 00:11:20,680
like climate prediction, biology and finance.

156
00:11:21,310 --> 00:11:25,180
The data in biology is completely different from the data in finance.

157
00:11:25,510 --> 00:11:29,920
And yet the machine learning code to process this data is exactly the same.

158
00:11:30,580 --> 00:11:35,770
And this is what we mean when we say all data is the same in the eyes of your machine learning model,

159
00:11:36,520 --> 00:11:38,980
and that is how you will practice what you've learned.

160
00:11:39,520 --> 00:11:44,770
Although you can't come up with the syntax for an API out of thin air, what you can do is internalize

161
00:11:44,770 --> 00:11:50,650
it by rewriting it again and again on new datasets, which are not just the generic data sets from this

162
00:11:50,650 --> 00:11:54,040
course, but data sets you really care about in your life.

163
00:11:54,970 --> 00:11:59,410
Furthermore, you'll need to test different hyper parameters on your own, which will force you to think

164
00:11:59,410 --> 00:12:01,480
about things like choosing the best learning rate.

165
00:12:01,720 --> 00:12:04,030
Finding the right number of layers and so forth.

166
00:12:05,230 --> 00:12:10,660
Now, of course, not all of you already have jobs where you have access to data sets that you want

167
00:12:10,660 --> 00:12:11,350
to use.

168
00:12:11,890 --> 00:12:17,080
In this case, you can still apply this approach by choosing any dataset you want to use.

169
00:12:17,680 --> 00:12:21,130
The beauty of this is you get to choose what you care about.

170
00:12:21,610 --> 00:12:25,630
I can't tell you what that is, but I'll trust that you can figure this out on your own.

171
00:12:26,440 --> 00:12:28,480
And so let me just make this explicit.

172
00:12:28,960 --> 00:12:31,660
You shouldn't depend on me to tell you to do this.

173
00:12:31,990 --> 00:12:38,020
This is just the obvious thing to do if you know why you're here and you're a productive and proactive

174
00:12:38,020 --> 00:12:43,210
student who is serious about learning the subject, then this is simply the obvious course of action.

175
00:12:47,840 --> 00:12:53,600
Now I want to end this lecture with a question for you, the students of this course, over the years,

176
00:12:53,600 --> 00:12:58,460
I've seen students get triggered by this lecture, meaning that they got really angry or offended by

177
00:12:58,460 --> 00:12:59,420
the things I've said.

178
00:12:59,930 --> 00:13:02,900
Now, personally, I don't understand why that's the case.

179
00:13:03,290 --> 00:13:08,570
So if that was the case for you or if you disagreed with anything I said in this lecture, please let

180
00:13:08,570 --> 00:13:10,250
me know about it on the Q&amp;A.

181
00:13:10,730 --> 00:13:15,620
I'm always available to listen to your concerns, so the sooner you can let me know, the sooner they

182
00:13:15,620 --> 00:13:16,430
will be dealt with.
