All problems
Prompt Tuning Params
Problem
Count the trainable parameters of prompt tuning (soft prompts): num_tokens * d_model, since every virtual token is a learnable embedding.
The signature is prompt_tuning_params(num_tokens, d_model). Return an integer.
Hint
Prompt tuning adds no new layers, just a handful of soft token embeddings.
Test cases
case 1
in: [20,768]
expected: 15360
case 2
in: [1,1]
expected: 1
case 3
in: [100,1024]
expected: 102400
case 4
in: [0,512]
expected: 0
Starter codePython
def prompt_tuning_params(num_tokens, d_model):
# Your code here
pass4 test cases · run your code against them in the editor