class_docstr: Helpfer function to run different algorithms and store the results
class_docstr_tok: ["Helpfer","function","to","run","different","algorithms","and","store","the","results"]
docstr: method to summarize the results
docstr_tok: ["method","to","summarize","the","results"]
code: def summarize_stats(self):
      """method to summarize the results"""
      self.run_algs()
      result = {}
      result["acc-best"] = self.compare_algs.accuracy_np().tolist()
      for alg in self.losses:
          result[alg] = {}
          loss_avg = np.mean(np.array(self.losses[alg]), axis=0)
          loss_std = np.std(np.array(self.losses[alg]), axis=0)
          result[alg]["loss_avg"] = (loss_avg).tolist()
          result[alg]["loss_std"] = (
              loss_std / np.sqrt(self.num_rep)
          ).tolist()
          gradnorm_avg = np.mean(np.array(self.gradnorm[alg]), axis=0)
          gradnorm_std = np.std(np.array(self.gradnorm[alg]), axis=0)
          result[alg]["gradnorm_avg"] = (gradnorm_avg).tolist()
          result[alg]["gradnorm_std"] = (gradnorm_std).tolist()
          acc_avg = np.mean(np.array(self.accuracy[alg]), axis=0)
          acc_std = np.std(np.array(self.accuracy[alg]), axis=0)
          result[alg]["acc_avg"] = (acc_avg).tolist()
          result[alg]["acc_std"] = (
              acc_std / np.sqrt(self.num_rep)
          ).tolist()
          clocktime_avg = np.mean(
              np.array(self.wall_clock[alg]), axis=0
          )
          clocktime_std = np.std(np.array(self.wall_clock[alg]), axis=0)
          result[alg]["clock_time_avg"] = (clocktime_avg).tolist()
          result[alg]["clock_time_std"] = (
              clocktime_std / np.sqrt(self.num_rep)
          ).tolist()
  
      return result
  
file_path: privacy/research/dp_newton/src/run.py
imports: import argparse
  import json
  from dataset_loader import Mydatasets
  from my_logistic_regression import MyLogisticRegression
  import numpy
  from opt_algs import CompareAlgs, DoubleNoiseMech, gd_priv, private_newton
  from scipy.optimize import fsolve
label_desc: Use image node_id 3 for calling the RunReleaseStats obj's underlying member method code with example usage: obj.summarize_stats() and returns: result