Trax mean layer

Does it compute the mean of each word embeddings or the mean each feature in the sentence?

Hi @Hermes_Morales_Gross

What computation are you talking about? There is no mean computation in Course 3 Week 3 Assignment or Lab.

It is presented in the video “Other layers” NLP Course 3 Week 1.

Enviado desde Correo para Windows

Your question is worded strangely. In this case features is embedding.

As you can see the line above states, that the mean (of the sentence) is calculated by taking average of each words’ embeddings. In this example the sentence has 3 words, the embedding size is 2 (each column represent different embedding/feature) and calculated:
(0.020 + (-0.003) + 0.009) / 3 = 0.009 and
(0.006 + 0.010 + 0.010) / 3 = 0.009

By the way, trax Mean layer has axis= parameter by which you can indicate over which dimension you want to take the mean. In this example the mean was taken with axis=0 (which gave you two numbers - means over words), if the argument would have been 1, then the result would have been three numbers - means over embedding values, which would not make much sense)