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
      33 of 102

      Too big for the computer

      The job from “Scores into chances”: turn a model’s scores into chances, one per option, that add up to 100%. But now the scores can be huge or very negative, like 1000 or −1000. Write chances(scores) so it never breaks.

      Plain softmax takes e to each score, then divides by the total. A float can hold numbers up to about 10³⁰⁸; anything bigger is just “inf”. Watch what that does to a model whose scores are in the thousands.

      A float can hold numbers up to about 10³⁰⁸. Past that, it can only say “inf”.110¹⁰⁰10²⁰⁰10³⁰⁰the wall: 10³⁰⁸, the biggest floateach ÷ their totalfirst9%second24.5%third66.5%
      Your functionchances(scores)
      scoresone number per option, can be huge or very negativee.g. [1, 2, 3]
      returnsone chance per option, adding up to 1
      solution.pyLoading Python
      Sign in for an AI hint
      ← Confident or cautiousRoll a loaded die →