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

      One step size per direction

      You’re walking down a long, narrow valley in the fog (“Walk downhill”). Across the valley the ground is 100× steeper than along it, so plain steps of step_size × slope bounce from wall to wall while you crawl along the floor. Write steps(slopes_seen, step_size): slopes_seen has, for each direction, every slope you’ve felt so far, oldest first. Return the step to take now in each direction, using step_size as the biggest step you’d ever take.

      slopes_seen: across the valley it’s 100× steeper than along it
      1st2nd3rd
      across22.41.6
      along0.020.0240.016
      solution.pyLoading Python
      ← The ball keeps rollingSame step, smaller batches →