2020-04-21 11:19:42 -04:00
|
|
|
---
|
|
|
|
id: 5e8f2f13c4cdbe86b5c72da1
|
2020-04-24 05:52:42 -05:00
|
|
|
title: 'Natural Language Processing With RNNs: Building the Model'
|
2020-04-21 11:19:42 -04:00
|
|
|
challengeType: 11
|
|
|
|
videoId: 32WBFS7lfsw
|
|
|
|
---
|
|
|
|
|
|
|
|
## Description
|
|
|
|
<section id='description'>
|
|
|
|
</section>
|
|
|
|
|
|
|
|
## Tests
|
|
|
|
<section id='tests'>
|
|
|
|
|
|
|
|
```yml
|
|
|
|
question:
|
2020-05-28 22:40:36 +09:00
|
|
|
text: |
|
|
|
|
Fill in the blanks below to complete the `build_model` function:
|
|
|
|
|
|
|
|
```py
|
|
|
|
def build_mode(vocab_size, embedding_dim, rnn_units, batch_size):
|
|
|
|
model = tf.keras.Sequential([
|
|
|
|
tf.keras.layers.Embedding(vocab_size,
|
2020-06-23 17:36:39 +05:30
|
|
|
embedding_dim,
|
2020-05-28 22:40:36 +09:00
|
|
|
batch_input_shape=[batch_size, None]),
|
|
|
|
tf.keras.layers.__A__(rnn_units,
|
|
|
|
return_sequences=__B__,
|
|
|
|
recurrent_initializer='glorot_uniform),
|
|
|
|
tf.keras.layers.Dense(__C__)
|
|
|
|
])
|
|
|
|
__D__
|
|
|
|
```
|
|
|
|
|
2020-04-21 11:19:42 -04:00
|
|
|
answers:
|
2020-05-28 22:40:36 +09:00
|
|
|
- |
|
|
|
|
A: `ELU`
|
|
|
|
|
|
|
|
B: `True`
|
|
|
|
|
|
|
|
C: `vocab_size`
|
|
|
|
|
|
|
|
D: `return model`
|
|
|
|
- |
|
|
|
|
A: `LSTM`
|
|
|
|
|
|
|
|
B: `False`
|
|
|
|
|
|
|
|
C: `batch_size`
|
|
|
|
|
|
|
|
D: `return model`
|
|
|
|
- |
|
|
|
|
A: `LSTM`
|
|
|
|
|
|
|
|
B: `True`
|
|
|
|
|
|
|
|
C: `vocab_size`
|
|
|
|
|
|
|
|
D: `return model`
|
2020-04-21 11:19:42 -04:00
|
|
|
solution: 3
|
|
|
|
```
|
|
|
|
|
|
|
|
</section>
|
|
|
|
|