Skip to content
DeepForgeby svx
All problems
EasyDeep Learningdl-104

Embedding Parameter Count

Problem

Count the parameters of an embedding table: vocab_size * d_model.

The signature is embedding_param_count(vocab_size, d_model). Return an integer.

Hint

Every vocabulary entry has its own d_model-dimensional row.

Test cases

case 1
in: [10000,512]
expected: 5120000
case 2
in: [1,1]
expected: 1
case 3
in: [32000,1024]
expected: 32768000
case 4
in: [50000,768]
expected: 38400000
Starter codePython
def embedding_param_count(vocab_size, d_model):
    # Your code here
    pass

4 test cases · run your code against them in the editor