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

      Don’t depend on the neighbours

      Deep in a network, a layer’s outputs can drift: some examples come out huge, some tiny, and the next layer struggles. Write normalize(batch): batch is a list of examples, each a list of one layer’s outputs. Rescale them so the next layer always sees numbers of a standard size, whatever came in. The starter uses the standard score from “Who did better?” with the whole batch’s average and spread.

      A layer’s outputs for example A, in a batch of two. The starter rescales the whole batch with its own average and spread. Watch what the next layer sees of A when its neighbour changes, though A itself doesn’t.

      A layer’s outputs for example A, in a batch with a quiet neighbour.the layer’s outputswhat the next layer sees(the starter: the batch’s standard score)example A1236−0.600.62.2a quiet neighbour0.5102.5normalizenormalize(batch) → what the next layer should see of A?
      Your functionnormalize(batch)
      batcha list of examples, each a list of one layer's outputse.g. [[1, 2, 3, 6], [0.5, 1, 0, 2.5]]
      returnsthe batch rescaled to a standard size, same shape
      solution.pyLoading Python
      Sign in for an AI hint
      ← Keep the originalRandom no-shows →