class_docstr: return a logistic regression problem
  
  There is a dataset consisting of features (vectors of norm <=1)
  and labels (+1,-1), represented as a numpy array.
  There is also an L2 regularizer.
docstr: Computes the Hessian of the logistic regression at a given point w.
  
  The Hessian is the matrix of second derivatives.
  
  If X,y is the data, then the Hessian is
  (1/n)sum_i^n X[i,:]*X[i,:]^T / (cosh(<w,W[i,:]*y[i]>/2)*2)^2
  where we assume y[i]^2==1.
code: def hess_wor(self, param, batch_idx=None):
      """Computes the Hessian of the logistic regression at a given point w.
  
      The Hessian is the matrix of second derivatives.
  
      If X,y is the data, then the Hessian is
      (1/n)sum_i^n X[i,:]*X[i,:]^T / (cosh(<w,W[i,:]*y[i]>/2)*2)^2
      where we assume y[i]^2==1.
      """
      if batch_idx is not None:
          data_batch = self.data[batch_idx]
          batch_size = len(batch_idx)
      else:
          data_batch = self.data
          batch_size = self.num_samples
  
      temp_var = np.dot(data_batch, param) / 2
      coeff_hess = 1 / (np.exp(temp_var) + np.exp(-temp_var)) ** 2
      raw_hess = np.dot(data_batch.T * coeff_hess, data_batch)
      return raw_hess / batch_size
  
file_path: privacy/research/dp_newton/src/my_logistic_regression.py
imports: import numpy
label_desc: Use image node_id 8 for calling the MyLogisticRegression obj's underlying member method code with example usage: obj.hess_wor(param, batch_idx) and returns: unknown