Structured data: Where is the embedding matrix created?

I am looking into lesson3-rossman code and not sure which line in the code is actually creating the embedding matrix.

We define an embedding size emb_szs
Then we create a learner like below

m = md.get_learner(emb_szs, len(df.columns)-len(cat_vars), 0.04, 1, [1000,500], [0.001,0.01], y_range=y_range)

Is this where we are creating the embedding matrix? I understand learner is essentially the model. In case of structured data problem, this is the entity embedding model right?

Please explain.

1 Like

Yes the embedding matrices are inside the learner. If you just type m you’ll see the contents of the learner, including the embedding matrices.



Why do we let both the embedding representation and the weights associated with embeddings get updated. Isn’t just one of them getting updated enough for the dot product?

One question in Case of structure data the if column name is not defined(renamed with random unique number),embedding matrix will be created in whole data set or we have to choose different approach.
Let me know how to handle this type of use case.