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

      The ball keeps rolling

      A ball rolls down the foggy hill from “Walk downhill”. Unlike the careful walker, it carries some of its motion from one step to the next. Write roll(state, slope, step_size, keep): the ball’s new state. state is [position, velocity], where the velocity is how far the ball moved on its last step (negative means to the left). Each step the slope pushes the ball downhill, and keep (0 to 1) is how much of its motion the ball keeps.

      state: at 3, moved 0.4 to the left last step
      positionvelocity
      3−0.4
      slope
      2
      keep
      0.9
      solution.pyLoading Python
      ← Smooth the noiseOne step size per direction →