A layer has 8 experts, small networks that each handle some words well. A router scored how well each expert suits each word of a sentence. Every word may visit 2 experts, and its output is a blend of their two answers. Write route(scores, capacity): for each word, a weight per expert, 0 for the experts it doesn’t visit, adding up to 1. No expert can take more than capacity words.
A sentence goes through a layer of 8 experts. A router scored how well each expert suits each word; each word may visit two experts, and each expert takes at most 3 words.
route(scores, capacity)| scores | one row per word, one score per expert (a numpy array, 8 x 8); higher suits better | e.g. [[3, 1, 5, 0, −1, −2, 2, −3], [0, 2, 4, −1… |
| capacity | the most words one expert can take | e.g. 8 |
| returns | one row per word: a weight for each expert, 0 for those it doesn't visit, adding up to 1 | |