1
00:00:00,000 --> 00:00:03,028
Another type of layer that
you can use is a convolution,

2
00:00:03,028 --> 00:00:05,676
in a very similar way to
what you did with images.

3
00:00:05,676 --> 00:00:08,788
The code to use a convolutional
on network is here.

4
00:00:08,788 --> 00:00:12,118
It's very similar to what you had before.

5
00:00:12,118 --> 00:00:16,092
You specify the number of convolutions
that you want to learn, their size, and

6
00:00:16,092 --> 00:00:17,590
their activation function.

7
00:00:17,590 --> 00:00:20,386
The effect of this will then be the same.

8
00:00:20,386 --> 00:00:25,533
Now words will be grouped into
the size of the filter in this case 5.

9
00:00:25,533 --> 00:00:30,017
And convolutions will learned that
can map the word classification to

10
00:00:30,017 --> 00:00:31,389
the desired output.

11
00:00:31,389 --> 00:00:36,175
If we train with the convolutions now,
we will see that our accuracy does

12
00:00:36,175 --> 00:00:40,648
even better than before with close
to about 100% on training and

13
00:00:40,648 --> 00:00:42,703
around 80% on validation.

14
00:00:42,703 --> 00:00:46,972
But as before,
our loss increases in the validation set,

15
00:00:46,972 --> 00:00:49,771
indicating potential overfilling.

16
00:00:49,771 --> 00:00:53,473
As I have a super simple network here,
it's not surprising, and

17
00:00:53,473 --> 00:00:57,109
it will take some experimentation
with different combinations

18
00:00:57,109 --> 00:00:59,752
of conversational layers
to improve on this.

19
00:00:59,752 --> 00:01:03,263
If we go back to the model and
explore the parameters,

20
00:01:03,263 --> 00:01:07,019
we'll see that we have 128
filters each for 5 words.

21
00:01:07,019 --> 00:01:11,108
And an exploration of the model
will show these dimensions.

22
00:01:11,108 --> 00:01:16,515
As the size of the input was 120 words,
and a filter that is 5 words

23
00:01:16,515 --> 00:01:22,593
long will shave off 2 words from
the front and back, leaving us with 116.

24
00:01:22,593 --> 00:01:27,516
The 128 filters that we
specified will show up here as

25
00:01:27,516 --> 00:01:30,563
part of the convolutional layer.