0
0
Prompt Engineering / GenAIml~10 mins

Embedding dimensionality considerations in Prompt Engineering / GenAI - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete 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'
A1000
B50
C10
D500
Attempts:
3 left
💡 Hint
Common Mistakes
Using output_dim instead of input_dim for vocabulary size.
Confusing embedding size with vocabulary size.
2fill in blank
medium

Complete 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'
A256
B64
C128
D32
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing input_dim with output_dim.
Choosing too small or too large embedding size without reason.
3fill in blank
hard

Fix 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'
Ainput_shape=5000
Boutput_dim=5000
Cinput_length=5000
Dinput_dim=5000
Attempts:
3 left
💡 Hint
Common Mistakes
Using output_dim instead of input_dim for vocabulary size.
Using input_length or input_shape incorrectly.
4fill in blank
hard

Fill 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'
Ainput_dim=2000
Binput_dim=64
C64
D2000
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping input_dim and output_dim values.
Using numeric values without parameter names for input_dim.
5fill in blank
hard

Fill 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'
Ainput_dim=3000
Boutput_dim=128
C50
Dinput_length=50
Attempts:
3 left
💡 Hint
Common Mistakes
Using input_length without parameter name.
Confusing output_dim with input_dim.
Putting input_length in wrong position.