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
      87 of 88

      One outlier ruins it

      To fit a big model on a small chip, each weight is stored as one byte: a whole number from −127 to 127, times a scale shared by a group of group_size neighbouring weights. A weight is stored as round(weight / scale) and comes back as stored × scale. Write quantize(weights, group_size): the weights as they come back out of storage.

      weights (group_size 4: two groups)
      12345678
      0.314−0.7710.120.5861.904−0.4420.074−1.233
      solution.pyLoading Python
      ← Is it the math or the memory?Don’t redo the work →