Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to create an embedding layer with the correct input dimension.
Prompt Engineering / GenAI
embedding_layer = Embedding(input_dim=[1], output_dim=50)
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using output_dim instead of input_dim for vocabulary size.
Confusing embedding size with vocabulary size.
✗ Incorrect
The input_dim should be the size of the vocabulary, which is 1000 in this example.
2fill in blank
mediumComplete the code to set the embedding output dimension to 128.
Prompt Engineering / GenAI
embedding_layer = Embedding(input_dim=1000, output_dim=[1])
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing input_dim with output_dim.
Choosing too small or too large embedding size without reason.
✗ Incorrect
The output_dim is the size of each embedding vector, set here to 128.
3fill in blank
hardFix the error in the code to correctly initialize an embedding layer with vocabulary size 5000 and embedding size 100.
Prompt Engineering / GenAI
embedding_layer = Embedding([1], output_dim=100)
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using output_dim instead of input_dim for vocabulary size.
Using input_length or input_shape incorrectly.
✗ Incorrect
The correct parameter for vocabulary size is input_dim=5000.
4fill in blank
hardFill both blanks to create an embedding layer with vocabulary size 2000 and embedding size 64.
Prompt Engineering / GenAI
embedding_layer = Embedding([1], output_dim=[2])
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping input_dim and output_dim values.
Using numeric values without parameter names for input_dim.
✗ Incorrect
input_dim=2000 sets vocabulary size; output_dim=64 sets embedding size.
5fill in blank
hardFill all three blanks to create an embedding layer with vocabulary size 3000, embedding size 128, and input length 50.
Prompt Engineering / GenAI
embedding_layer = Embedding([1], [2], input_length=[3])
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using input_length without parameter name.
Confusing output_dim with input_dim.
Putting input_length in wrong position.
✗ Incorrect
input_dim=3000 sets vocabulary size, output_dim=128 sets embedding size, input_length=50 sets input sequence length.