code: def private_newton(w_cur, lrp, hyper_dict):
      """implementation of private newton method from [ABL21]
  
      w = current iterate
      lr = an instance of MyLogisticRegression
      i = the index of current iterate
      iters = total number of iterations
      pb =  privacy budget and other info
      return the next iterate
      """
      total = hyper_dict["total"]
      grad_frac = hyper_dict["grad_frac"]
      iters = hyper_dict["num_iteration"]
      hess = lrp.hess(w_cur)
      rho_grad = (
          grad_frac * total / iters
      )  # divide total privacy budget up.
      rho_hess = (1 - grad_frac) * total / iters
      hess_noise = np.random.normal(
          scale=(0.25 / lrp.num_samples) * np.sqrt(0.5 / rho_hess),
          size=(lrp.dim, lrp.dim),
      )
      hess_noise = (hess_noise + hess_noise.T) / 2
      hess_noisy = eigenclip(hess + hess_noise)
      grad = lrp.grad(w_cur)
      grad_noisy = grad + np.random.normal(
          scale=(1 / lrp.num_samples) * np.sqrt(0.5 / rho_grad),
          size=lrp.dim,
      )
      dir_noisy = np.linalg.solve(hess_noisy, grad_noisy)
      dir_size = np.linalg.norm(np.linalg.solve(hess, grad))
      return (
          w_cur
          - min(np.log(1 + dir_size) * (1 / dir_size), 1) * dir_noisy
      )
  
imports: import time
  from my_logistic_regression import MyLogisticRegression
  import numpy
label_desc: Use image node_id 1 for calling a global function with example usage: private_newton(w_cur, lrp, hyper_dict) and returns: unknown