Black Friday Sale: 20% off Premium yearly · $105.60 for the first year · until Monday, Nov 30Get it

Deep-ML
Learn
ProblemsPractice, projects, collections, and your progressLearning PathA guided route through the fundamentalsLabsInteractive labs on real techniquesProjectsBuild a GPT, an RL agent, CUDA kernelsCollectionsCurated problem sets and videosMathPen-and-paper math for MLIntuitionInvent the idea behind the formula yourselfPlaylistsYour own problem lists, shareableStudy AssistantAn AI teacher that knows your progress
Interview Prep
Compete
ContestsFresh problem sets, ranked liveLeaderboardWhere you stand, globallyBuddiesSolve with a friend: streaks, a weekly board, chat
Discuss
Deep-Path
Premium
      Intuition
      117 of 130

      Send it to the right expert

      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.

      A layer of 8 experts. A router scored how well each suits each word.acatsatonmywarmredmatexpert 0expert 1expert 2expert 3expert 4expert 5expert 6expert 7“cat”: the router’s scores, and the blend weights024?−1−35?1−2
      Your functionroute(scores, capacity)
      scoresone row per word, one score per expert (a numpy array, 8 x 8); higher suits bettere.g. [[3, 1, 5, 0, −1, −2, 2, −3], [0, 2, 4, −1…
      capacitythe most words one expert can takee.g. 8
      returnsone row per word: a weight for each expert, 0 for those it doesn't visit, adding up to 1
      solution.pyLoading Python
      Sign in for an AI hint
      ← Big team, small billA reward now or later →