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

      Keep the signal alive

      A network passes numbers from layer to layer. Each unit takes all the numbers coming in (here 100 of them), multiplies each one by its own random weight, and adds them up. Start those weights at about 1 and adding 100 numbers makes them about 10× bigger at every layer: after 20 layers they are 10²⁰ times too big (watch it below). Write weight_size: how big the random starting weights should be, one number like 0.5 or 0.01. The goal is ×1: every layer should hand on numbers the same size it got, so after 20 layers they are still about the size they went in (anywhere from ×0.5 to ×2 passes).

      weights of about 1

      One neuron with weights of about 1. It multiplies each of its 100 inputs by its weight and adds up the results.

      input × weightterm−0.77 × 0.60−0.460.48 × 0.550.26−0.49 × 0.89−0.441.94 × −0.50−0.970.37 × 0.150.055−0.46 × −0.800.36⋮ 94 more0 of 100 addedouttotal0
      click a neuron to see inside itwent in as 1, came out as 10²⁰: blown up
      Your functionweight_size(inputs_per_unit, relu)
      inputs_per_unithow many inputs each unit adds upe.g. 1
      reluTrue when a ReLU follows every layere.g. False
      returnshow big the random starting weights should be, e.g. 0.5
      solution.pyLoading Python
      Sign in for an AI hint
      ← Stacking straight linesKeep the original →