input: Write a function to implement the Gradient Descent algorithm for linear regression in Python. The function should take two numpy arrays, x and y, as input along with optional parameters for learning rate and number of iterations. The function should return the final values of the slope (m) and intercept (b) after performing the gradient descent.
  assert gradient_descent(np.array([1, 2, 3, 4]), np.array([3, 5, 7, 9]))==(2.0000000000000018, 0.9999999999999724)
  assert gradient_descent(np.array([0, 1, 2, 3]), np.array([1, 3, 5, 7]))==(2.0000000000000018, 1.0000000000000022)
  assert gradient_descent(np.array([1, 3, 5, 7]), np.array([2, 4, 6, 8]))==(1.0000000000000016, 0.9999999999999984)
  assert gradient_descent(np.array([1, 2, 3, 4]), np.array([2.5, 4.5, 6.5, 8.5]))==(2.0000000000000018, 0.4999999999999937)
  
output: def gradient_descent(x, y, learning_rate=0.01, num_iterations=1000):
      m, b = 0, 0
      n = len(x)
      
      for _ in range(num_iterations):
          y_pred = m * x + b
          dm = (-2/n) * sum(x * (y - y_pred))
          db = (-2/n) * sum(y - y_pred)
          m -= learning_rate * dm
          b -= learning_rate * db
      
      return m, b