Geometric progression to search for stepsize.
      Keep decreasing stepsize by half until reaching
      the desired side of the boundary.

def geometric_progression_for_stepsize(x, update, dist, decision_function,
                                       current_iteration):
  """ Geometric progression to search for stepsize.
      Keep decreasing stepsize by half until reaching
      the desired side of the boundary.
  """
  epsilon = dist / np.sqrt(current_iteration)
  while True:
    updated = x + epsilon * update
    success = decision_function(updated[None])[0]
    if success:
      break
    else:
      epsilon = epsilon / 2.0

  return epsilon