Black Friday Sale: 20% off Premium yearly · $105.60 for the first year · until Monday, Nov 30Get it

Deep-ML
Learn
ProblemsPractice, projects, collections, and your progressLearning 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
      88 of 130

      Stacking straight lines

      A network can only multiply and add, so on its own it only draws straight lines. Write bend(value): it gets one number, whatever arrives at a hidden unit (when x is 2, the top unit gets 2 and the bottom one gets −2), and returns the number that unit passes on. The same bend goes into both networks below: network 1 adds the two units and must draw a V; network 2 subtracts them and must still draw the straight line x.

      x goes in: the top unit’s bend gets x as its value, the bottom one’s gets −x. Network 1 adds what comes out, network 2 subtracts it. What should bend pass on?

      network 1: bend(x) + bend(−x)x−x++xbendbend−33−33should draw a Vnetwork 2: bend(x) − bend(−x)x−x+−xbendbend−33−33should draw the line x
      Your functionbend(value)
      valueone number arriving at a hidden unit, e.g. 2 or -2e.g. −3
      returnsthe number that unit passes on
      solution.pyLoading Python
      Sign in for an AI hint
      ← Every input meets every errorKeep the signal alive →