All problems
Static Covariate Embedding Count
Problem
Count the embedding parameters for static covariates: sum of cardinality * embedding_dim elementwise.
Return the total count. Static covariates do not change over time.
Hint
Each categorical variable costs one row of embedding weights per category.
Test cases
case 1
in: [[10,5],[4,2]]
expected: 50
case 2
in: [[3],[1]]
expected: 3
case 3
in: [[],[]]
expected: 0
case 4
in: [[100],[8]]
expected: 800
Starter codePython
def static_covariate_embedding_count(cardinalities, embedding_dims):
# Your code here
pass4 test cases · run your code against them in the editor