input: Write a function to optimize a given function using gradient descent.
  assert optimize_function(np.array([1, 2, 3]), 0.01, 100).shape == (3,)
  assert isinstance(optimize_function(np.array([1.0, -1.5, 2.0]), 0.1, 50), np.ndarray)
  assert len(optimize_function(np.array([0.5, 0.2, -0.1]), 0.05, 200)) == 3
output: import numpy as np
  
  def optimize_function(initial_params, learning_rate, num_iterations):
      params = initial_params
      for _ in range(num_iterations):
          gradients = 2 * params  # Assuming the function to optimize is f(x) = x^2
          params = params - learning_rate * gradients
      return params