Spooky Sale: 10% off Premium yearly · $118.80 for the first year · until Nov 6Get it

Deep-ML
Learn
Problems1,200+ hands-on ML problemsLearning 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
      24 of 102

      King − man + woman

      A model can learn a short list of numbers for every word, so that words with similar meanings sit close together (“Invent the score”). Write complete(a, b, c, vectors): “a is to b as c is to ?”, like “man is to king as woman is to ?”. vectors maps every word to its numbers. Return a word.

      A model learned two numbers for every word, so each word is a point on a map. Your function gets three words of an analogy and the map, and hands back the word that completes it.

      Man is to king as woman is to ?manwomankingqueengirlapplecar
      click a word to see its numberswhich word should come out? that’s for you to decide
      Your functioncomplete(a, b, c, vectors)
      awords: a is to b as c is to ?e.g. "man"
      bwords: a is to b as c is to ?e.g. "king"
      cwords: a is to b as c is to ?e.g. "woman"
      vectors{"man": [1.0, 1.0], "king": [4.0, 1.0], ...}e.g. {"man", "woman", "king", "queen", …}
      returnsa word: the closest word to c
      solution.pyLoading Python
      Sign in for an AI hint
      ← The tenth mentionHow much does it stretch? →